很明显:
\n = CR (Carriage Return) // Used as a new line character in Unix
\r = LF (Line Feed) // Used as a new line character in Mac OS
\r\n = CR + LF // Used as a new line character in Windows
(char)13 = \n = CR // Same as \n
但后来我也听说对于 HTML textarea,当它被 php 脚本提交和解析时,所有新行都被转换为 \r\n 而不管平台
这是真的吗?我可以依靠这个还是我完全错了?
IE。如果我想根据新行做explode(),我可以使用'\r\n'作为分隔符,无论用户是否使用mac、pc等