I have a php CLI script and cannot get the output to break on new lines. I do
echo \'this is my text\\r\\n\'; echo \'next line\';
This gives
Better not to concatenate anything in PHP, because it may lead to unexpected results, instead use a comma:
echo 'Text with new line' , PHP_EOL;
This will be faster too by the way: not concatenating and avoiding parsed double quotes.