file_put_contents函数写入数据的问题 file_put_contents函数怎么写入数据 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 使用fwrite和file_put_contents函数写入数据 <?php $filepath = "05.txt"; $str = "此情可待成追忆 只是当时已惘然<br>"; echo "用fwrite函数写入文件:"; $fopen = fopen($filepath,'wb') or die('文件不存在'); fwrite($fopen,$str); fclose($fopen); readfile($filepath); echo "<p>用file_put_contents函数写入文件:"; file_put_contents($filepath,$str); readfile($filepath);?>http://www.phpzc.com/read.php?tid-690.html 遇到什么问题吗?若问用法,请参考PHP手册以及相关页面实例 http://www.phpzc.com/read.php?tid-690.html 这个上面是个完整例子吧 不过还是谢谢二楼 这下碉堡了...公司做了这么大广告。我怕网站承受不了,大伙给出出招! UE32编辑器的问题,菜单字体如何改 请教前辈们,关于PHP.INI的问题,拜托版主不要删除或转移 关于正则表达式的一个疑问 PHP的is_file()和is_dir()问题 请问这个程序哪里有问题? 大家来看看,这样的验证码识别难度大不? php错误提示没了,怎么办. 知道怎么用正则吗? 像一些网站中的相关商品如何做啊?? PHP生成图片带BOM的问题? 在js中怎么取出php的变量值
$filepath = "05.txt";
$str = "此情可待成追忆 只是当时已惘然<br>";
echo "用fwrite函数写入文件:";
$fopen = fopen($filepath,'wb') or die('文件不存在');
fwrite($fopen,$str);
fclose($fopen);
readfile($filepath);
echo "<p>用file_put_contents函数写入文件:";
file_put_contents($filepath,$str);
readfile($filepath);
?>http://www.phpzc.com/read.php?tid-690.html
若问用法,请参考PHP手册以及相关页面实例