Mega Code Archive

 
Categories / Php / File Directory
 

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