For some strange reason, inserting echo \"\\n\"; and other scape sequence characters are not working for me, that\'s why I am just using
When you run a PHP script in a browser, it will be rendered as HTML by default. If the books you’re using show otherwise, then either the code or the illustration is inaccurate. You can use “view source” to view what was sent to the browser and you’ll see that your line feeds are present.
This will render in your browser as:
Line 1 Line 2
If you need to send plain text to your browser, you can use something like:
This will output:
Line 1
Line 2
PHP Linefeeds (\n) Not Working is referring to sending output to a file rather than the browser.