I understand that:
'\n' // literally the backslash character followed by the character for lowercase n
"\n" // interpreted by php as the newline character
But for the life of me, I can't understand why '\n' === '\\n'
. In my mind, '\\n'
would equal three separate characters: two separate backslashes, followed by the letter n.
Why is '\n' === '\\n'
true in PHP?