According to the manual, if you select a/a+
mode in the fopen()
function, the file pointer will be placed at the end.
But why do I get 0 using the ftell()
and the feof()
still returns false
? If the file pointer is at the end.
e.g:
$handle=fopen("./file.txt","w");
fwrite($handle,1234567890);
fclose($handle);
$handle=fopen("./file.txt","a+");
echo getc($handle);
fclose($handle);
I got 1, but shouldn't I get 0 if the file pointer is placed at the end?
Right there in the documentation, near the top: