I’m running a PHP script via the command line and trying to get output printed on new lines. I’ve tried all of the usual suspects (\n,\r,\l) but nothing is working. I’m accessing my Ubuntu server using PuTTY over SSH. Here’s my code:
echo($string.'\r');
You need to use double quotes:
single quoted strings do not honor ANY metacharacters, except the backslash itself.