New Line on PHP CLI

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

this is my text\r\nnext line

Any ideas about how to get the output on different lines?


Solution 1:

Use double quotes ".

echo "next line\n";

Additional you can use the system-dependent constant PHP_EOL

echo "this is my text" . PHP_EOL;

Solution 2:

Use double quotes instead. ".

Solution 3:

Escape sequences are only parsed when inside double quotes, not single quotes.

http://php.net/manual/en/language.types.string.php