In most cases, as for one interactive website, when we output multiple lines of contents to web client browser, in my opinion, is much more prefer
You can create a function with Flavio's code, that always sets the correct newline, no matter if you run it on the shell or in the browser:
/i', PHP_EOL, $string); return nl2br($string); } print nl("One\nTwoThree\r\nFourFive Six" . PHP_EOL); ?>