欧卡2中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

需要三步,才能开始

只需两步,慢速开始

查看: 4822|回复: 1
收起左侧

PHP fwrite 换行写入

[复制链接]
知行 发表于 2012-8-25 13:05 | 显示全部楼层 |阅读模式


如果要在文件中实现换行写入,只需要在写入内容中需要换行的地方添加换行符 n 即可:
<?php filename=file.txt;word = "你好!n"; fh=fopen(filename, "a"); echo fwrite(fh,word); fclose(fh);?>nn使使nnPHPnwindowsnr<?phpword = "你好!rn"; ?>
 楼主| 知行 发表于 2012-8-25 18:33 | 显示全部楼层
\n  not n

客服QQ936487697|联系我们|手机版|欧卡2中国 ( 湘ICP备11020288号-1 )

GMT+8, 2025-4-28 15:05 , Processed in 0.030871 second(s), 7 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表