Definition: The feof () PHP Function is used to test for the end of a file. It is often used in a loop, to keep a process going until everything in the document has been processed. It is phrased as: feof($file) but more often seen as !feof($file).
Examples:
<?phpThis returns the data from the file as long as feof () is not true. When it is true (you have reached the end of the file) then the loop is exited.
$myFile = "YourFile.txt";
$handle = fopen($myFile, 'r');
while (!feof($handle))
{
$data = fgets($handle, 512);
echo $data;
echo "<br>";
}
fclose($handle);
?>

