demo_file_feof.php:
<!DOCTYPE html> <html> <body> <?php $myfile = fopen("webdictionary.txt", "r") or die("Unable to open file!"); // Output one line until end-of-file while(!feof($myfile)) { echo fgets($myfile) . "<br>"; } fclose($myfile); ?> </body> </html>