php的fwrite和file_put_contants有啥不一样啊.求大神简单点?
fwrite写入字符串
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
?>
上面的代码将输出:
21
file_put_contants写入字符串
<?php
file_put_contants("test.txt","Hello World. Testing!");
?>
一句话,file_put_contants() 封装了封装了文件打开,关闭的过程.

