fgets() function returns a string read from a file.
Its syntax is: string fgets (int filepointer, int length)
<?
$fh = fopen("data.txt", "r");
while (! feof($fh)) :
$line = fgets($fh, 4096);
print $line."<br>";
endwhile;
fclose($fh);
?>
Related examples in the same category