Home  >  Article  >  Backend Development  >  通用的php换行写法,该如何解决

通用的php换行写法,该如何解决

WBOY
WBOYOriginal
2016-06-13 12:22:16960browse

通用的php换行写法
已经知道  :  linux使用"\n",windows"\r\n"  ,表示换行。
现在,可否用一种通用的方法,在写入换行符号的时候不用考虑什么操作系统,
用一种通用的方式写入换行符号?
------解决思路----------------------

<br /> echo PHP_EOL;<br />    //windows平台相当于    echo "\r\n";<br />    //unix\linux平台相当于    echo "\n";<br />    //mac平台相当于    echo "\r";<br />

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn