feof

It checks for end-of-file on a file pointer

Example

<?php

$fp = fopen(‘test.txt’, ‘r’);

while (!feof($fp)) {

 }

fclose($fp);

?>