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

WBOY
Release: 2016-06-13 12:22:16
Original
956 people have browsed it

通用的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 />
Copy after login

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!