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); ?>