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

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

WBOY
WBOYoriginal
2016-07-21 14:59:271231parcourir

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

复制代码 代码如下:

$stream = fopen("robots.txt", "w+");
fwrite($stream, "你换行了吗\r\n我已经换行了!");
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/328146.htmlTechArticle今天遇到了一个问题就是用fwrite写入txt文件的时候用 rn不能换行 试了很久都没找到办法! 突然之间想到一个东东以前看书见过后来还是用这...
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