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

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

WBOY
WBOYOriginal
2016-06-13 10:38:421081browse

PHP写入txt时的换行符问题

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

windows是\r\n

linux是\n

mac是\r

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