Maison  >  Article  >  développement back-end  >  浅析php fwrite写入txt文件的时候用 rn不能换行的问题

浅析php fwrite写入txt文件的时候用 rn不能换行的问题

WBOY
WBOYoriginal
2016-06-23 14:37:271244parcourir

以下是对php中fwrite写入txt文件的时候用 \r\n不能换行的问题进行了介绍,需要的朋友可以过来参考下
今天遇到了一个问题就是用fwrite写入txt文件的时候用 rn不能换行
试了很久都没找到办法!
突然之间想到一个东东以前看书见过后来还是用这个东东给解决了!
现在写出来预防将来忘记也希望能帮到需要帮助的朋友!
直接看代码:

<?php$stream = fopen("robots.txt", "w+");fwrite($stream, "你换行了吗\r\n我已经换行了!");//来源:www.jbxue.com?>

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn