I've started learning PHP and I've been using the Netbeans IDE.
I've been having an issue with Netbeans when I try to echo exact multiline text, as it is just coming out on one line.
I've tried \n, \r, and <<<_END ... _END; but the text still comes out on one line so I think it's an issue with Netbeans itself. Any help would be appreciated.
This has nothing to do with your editor. If you view the output in a browser, it is correct that no line break will be visible by using
\r\n. The browser renders HTML and so you only see a new line if you echo a
<br> (the HTML tag for linebreak). However If you view the source of your generated HTML in your browser you should see a line break for
Another way to display
\r\n line breaks in your browser is to use
echo "<pre>"; echo "line 1 \r\n"; echo "line 2 \r\n"; echo "</pre>";