Only double quoted strings interpret the escape sequences \r
and \n
as ‘0x0D’ and ‘0x0A’ respectively, so you want:
"\r\n"
Single quoted strings, on the other hand, only know the escape sequences \\
and \'
.
So unless you concatenate the single quoted string with a line break generated elsewhere (e. g., using double quoted string "\r\n"
or using chr
function chr(0x0D).chr(0x0A)
), the only other way to have a line break within a single quoted string is to literally type it with your editor:
$s = 'some text before the line break some text after';
Make sure to check your editor for its line break settings if you require some specific character sequence (\r\n
for example).
Related Posts:
- add_filter the_content str_replace after shortcode
- How to check if new posts have been published since page load?
- WordPress as a backend only. How to output database content on public side without WordPress?
- How do I create a WP user outside of WordPress and auto login?
- WordPress will not operate correctly
- WordPress Custom Page Template in a different directory
- How to stop loading multiple copies of jquery
- Update WordPress Custom Field with AJAX on cached page
- Post from one loop in different containers?
- Adding php directly into widget shortcode
- Custom Loop Pagination on WordPress
- How to run multiple websites from single WordPress setup
- where to include a php file
- WordPress doesn’t include css
- Create an array from an array
- How to add Shortcode (font awesome) in widget title?
- Understanding child theme functions.php
- WordPress 2.8.5 & ‘Responsive Twenty Ten’ – error
- Continue execution after WP REST API response
- WordPress Ajax Custom Query – High CPU LOAD
- Returning a value from a PHP page
- Must Use Plugin Causing Query Error
- action hook wp_head higher priority as all other plugins/hooks
- Where would I place `wp_footer();`?
- Shortcode return function with link href inside PHP
- PHP get the first post separately from array returned by wpdb->get_results()
- Can’t get page content in WordPress
- How can I add multiple ‘tax_query’ arrays via a loop?
- How to add just one specific page to widget without plugin?
- How to use transient in this code for related post?
- adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again
- Woocommerce hook run after an Order been created through REST API
- How to remove ?wp-mce-4103-20162941
- How to pre populate a form field with a link of a current user’s author profile?
- How to make own crop image function for WordPress plugin
- need help with existing code showing subpages
- Using the_excerpt() on a page
- Showing latest post without 301 redirect
- PHP echo inside javascript
- get_total () returns 0 – woocommerce [closed]
- php include not working in custom page
- Building a REST API for your web app exposes primary keys of DB records?
- php redirect with custom user roles set and working but redirect not working for when users are logged in
- Display Yoast meta-description `wpseo_desc` within loop of categories and fail silently if no data is set [closed]
- $_SESSION variables work perfectly on my local machine but returns NULL on development webserver
- Creating black and white copy of an image [closed]
- PHP code inside Shortcode
- Amend theme php to include certain category in header
- Add categorys to custom post type not working
- How to insert data from metabox to custom table
- call adminbar greeting in other place
- is user member of a group, show them categories [closed]
- How to add ASCII symbol after each recent post [closed]
- Limit the number of child pages
- WP_LINK_PAGES Generating Unnecessary Tag
- Why is home page content not displaying with this rewrite rule?
- How to show upcoming events according to start date field
- Some problems in custom widget
- Call a function in functions.php from within tags (JS)
- Displaying images outside the content
- WordPress Conditional / Multiple Taxonomy Query
- Add class to ul and li in wp_na
- How can i programmatically change the SKU of a product based on product variation?
- Export post data with xml to other site using php soap
- Show related products by attribute based and certain conditions
- How to retrieve taxonomy Metabox fields in frontend
- PHP function for horizontal Woocommerce thumbnails and badges
- How to count active users on a specific page
- WooCommerce display price before add to cart [closed]
- How to route root path / to /xyz in nginx?
- Get the same SKU from woocommerce itself for simple and variable products
- Create dashboard widget for custom theme support
- The style.php file inside theme-engine folder has other content on FTP
- how to add custom select field to wordpress edit page
- How to override html codes in wordpress?
- Insert data from form to database
- My search results are only showing 5 posts?
- WP_query meta_query slow with OR and DATES
- WordPress Query Crashes Browser
- Plugin Modification Change Functionality For Logged User Only
- How can I output the slug of a comment author?
- Matching multi user
- customizer live preview layout picker
- Modify category archive page loop on functions.php
- On a custom template, should I use wp_footer? [duplicate]
- Front end post submissions do not get submitted in the category
- How to display html code on homepage
- two wordpress sites, two themes, one database, same content
- how to check for wordpress Query errors
- Check if values exists DB
- Trying to exclude posts from a category on the home page
- Php conditional help needed
- Adapting a php array to WordPress
- Different layout on search page depending on category post
- WordPress and magic quotes
- Dynamically pull the correct email address from a match
- Issues trying to add a href statment with PHP into a PHP Echo Statement [closed]
- Help with if/else loop [closed]
- Import js variables loaded via wp_localize_script() into js module without global scope connection
- Custom taxonomy with page post type – WordPress