php - 關於fwrite和fread操作同一個文件
怪我咯
怪我咯 2017-05-16 12:02:35
0
3
1652
$fp = fopen("./log", "a+");
fwrite($fp,"helloworld");
rewind($fp);
var_dump( fread($fp, 10) );
fclose($fp);

執行這段程式碼,檔案裡被寫入了兩個helloworld,這是為什麼?
還有就是這段話怎麼理解:

Update mode permits reading and writing the same file; fflush or a
file-positioning function must be called between a read and a write or
vice versa。或 "w+b", that indicates a binary file. Filenames are limited to
FILENAME_MAX characters. At most FOPEN_MAX files may be open at once.

怪我咯
怪我咯

走同样的路,发现不同的人生

全部回覆(3)
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!