Reading lines from a file : feof « File Directory « PHP






Reading lines from a file

 
<?php
$fh = fopen('orders.txt','r') or die($php_errormsg);
while (! feof($fh)) {
    $s = fgets($fh,256);
    process_order($s);
}
fclose($fh)                   or die($php_errormsg);
?>
  
  








Related examples in the same category

1.Counting lines in a file
2.feof.php
3.Read till the end of a file