为了账号安全,请及时绑定邮箱和手机立即绑定
<?php
$filename = '/data/webroot/usercode/code/test2.txt';
//写入一个字符串到ame文件中
file_put_contents($filename, 'hello world');
$fp = fopen('./test.txt', 'w');
fwrite($fp, 'hello');
fwrite($fp, 'world');
fclose($fp);

两种打开文件的操作啊!

正在回答

1 回答

fopen('./test.txt', 'w'); 表示用写入方式打开'./test.txt文件,fwrite是写入操作

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号