Definition: The PHP function fgets () is used to read a file line by line. This will only work if the file data is stored on separate new lines, if it is not this will not produce the results you are looking for. It is phrased as: fgets (handle, length). The File must be opened in the handle. Length does not need to be included, but it will default to 1024 bytes if it is not specified.
Examples:
<?php
$myFile = "YourFile.txt";
$handle = fopen($myFile, 'r');
while (!feof($handle))
{
$data = fgets($handle, 512);
echo $data;
echo "<br>";
}
fclose($handle);
?>

