English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Filesystem Reference Manual
The feof() function checks if the "end of file" (EOF) has been reached. If an error occurs or the EOF is reached, this function can return true, otherwise it can return false.
bool feof ( resource $handle )
Test if the file pointer has reached the end of the file. The feof() function can be used to traverse data of unknown length.
<?php $file = fopen("/PhpProject/sample.txt, "r"); //Output a line from the file until the end while(! feof($file)) { echo fgets($file); } fclose($file); ?>
Output Result
oldtoolbag.com www.oldtoolbag.com