fgets.php : fgets « File Directory « PHP






fgets.php

 
<?php
   $fh = fopen("/home/www/data/users.txt", "rt");
   while (!feof($fh)) echo fgets($fh);
   fclose($fh);
?>
  
  








Related examples in the same category

1.Checking for an error from fopen(), fgets(), or fclose()
2.Counting paragraphs in a file
3.Counting records in a file
4.Creating and Using a File Class
5.Reading a compressed file
6.Reading a file a line at a time
7.fgets() function returns a string read from a file.
8.Processing a list of books
9.Processing each word in a file