fgetc() function returns one character from the file or returns false on reaching the end of file. : fgetc « File Directory « PHP






fgetc() function returns one character from the file or returns false on reaching the end of file.

 
Its syntax is: string fgetc (int filepointer)

<?
$fh = fopen("data.txt", "r");
while (! feof($fh)) :
     $char = fgetc($fh);
     print $char;
endwhile;

fclose($fh);
?>
  
  








Related examples in the same category

1.Reading Characters with fgetc()