Home > Backend Development > PHP Tutorial > PHP写入txt时的换行符有关问题

PHP写入txt时的换行符有关问题

WBOY
Release: 2016-06-13 13:19:24
Original
1106 people have browsed it

PHP写入txt时的换行符问题

在windows下将数据存入txt文件时,发现只输入"\n"起不到换行的效果,经过测试发现在文本文件中换行要根据操作系统来定:

windows是\r\n

linux是\n

mac是\r

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