Read file line by line in PHP
Description
The following code shows how to read file line by line.
Example
/*from w w w . j a va 2 s . c om*/
<?php
$file = fopen("test.txt","r");
while(! feof($file)){
echo fgets($file). "<br />";
}
fclose($file);
?>
The code above generates the following result.