How to use feof() function to check if file pointer reach end-of-file in PHP

1 Answer

0 votes
if ($fp = fopen('c:/xampp/htdocs/knowrex.com/index.php', 'r'))
{
 do {
      $line = fgets($fp);
      echo $line;
      
 } while (!feof($fp));
}   
fclose($fp);

/*
run:

"; echo "Error: $errstr
"; echo "mysql_ping : " . (mysql_ping($con) ? "LIVE" : "DEAD") . "
"; echo "Line : $errline
"; echo "
"; } // --------------------------------------
...
 
*/

 



answered Apr 19, 2016 by avibootz

Related questions

...