I try to use single quotes as much as possible and I\'ve noticed that I can\'t use \\n in single quotes. I know I can just enter a newline literally by pressing return, but
I wonder why no one added the alternative of using the function chr()
:
echo 'Hello World!' . chr(10);
or, more efficient if you're going to repeat it a million times:
define('C_NewLine', chr(10));
...
echo 'Hello World!' . C_NewLine;
This avoids the silly-looking notation of concatenating a single- and double-quoted string.