php - 关于fwrite和fread操作同一个文件
怪我咯
怪我咯 2017-05-16 12:02:35
0
3
1648
$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. If the mode includes b after the initial letter, as in
"rb" or "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学习者快速成长!