Phpfeof function. The following is a special feof tutorial with implementations. The following is a special feof tutorial with implementations. Feof (PHP4, PHP5) feof-the end file of the test file refers to a special feof tutorial, implementation, and so on.
The following is a special feof tutorial with implementations.
Feof
(PHP 4 and PHP 5)
Feof-pointer to the end of the test file
Description
Boolean feof (resource $ processing)
File pointer at the end of the test.
Parameters
Handle
The file pointer must be valid and must point to a file that successfully opens fopen () or fsockopen () (and has not closed fclose ()).
Return value
Returns TRUE. if the file pointer is EOF analysis or an error occurs (including socket timeout), otherwise, FALSE is returned.
Note
Warning
If a connection is opened and fsockopen () does not close the server, feof () will wait until the timeout value reaches TRUE. The default timeout value is 60 seconds. You can use stream_set_timeout () to change this value.
Warning
If the file pointer is invalid, you will get an infinite loop because feof () does not return TRUE.
Look at the instance:
// If file can not be read or doesn't exist fopen function returns FALSE
$ File = @ fopen ("no_such_file", "r ");
// FALSE from fopen will issue warning and result in infinite loop here
While (! Feof ($ file )){
}
Fclose ($ file );
?>
Tutorials and implementations. The following is a special feof tutorial with implementations. Feof (PHP 4, PHP 5) feof-the end of the test file refers...