模式为a的fopen不会将指针设置为结束


fopen with mode a does not set pointer to the end

我希望这个

$handle = fopen('file.txt', 'a');
var_dump(feof($handle));

返回true,因为模式"a"将指针设置在文件末尾。相反,结果是假的。

feof()不会告诉您已到达文件的末尾,除非您执行了读取操作。由于不能从仅追加的文件中读取,feof()永远不会返回true。