Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 PHP 中,"\n" 充当您所在操作系统的 eol,因此这是不可靠的。
另外,我知道 PHP 有 EOL 的常量,这不是我真正要问的,我想知道我可以从浏览器中可靠地检查什么 EOL 值。
您应该查看 HTML 规范:http ://www.w3.org/TR/html401/struct/text.html
但简而言之,我相信这会回答你的问题。
换行符定义为回车(
)、换行(
)或回车/换行对。所有换行符构成空白。
(
)
(
)