我的理解是:爲什麼' n'==='\ n'在PHP中爲true?
'\n' // literally the backslash character followed by the character for lowercase n
"\n" // interpreted by php as the newline character
但對我的生活,我不明白爲什麼'\n' === '\\n'
。在我看來,'\\n'
將等於三個獨立的字符:兩個單獨的反斜槓,後面跟着字母n。
爲什麼'\n' === '\\n'
在PHP中爲真?
可能重複[在PHP中,我需要逃避反斜槓?](http://stackoverflow.com/questions/3415683/in-php-do-i-need-to-escape-backslashes)和[之間的差異單引號和雙引號字符串在PHP](http://stackoverflow.com/questions/3446216/difference-between-single-quote-and-double-quote-string-in-php) – mario