Its syntax is: string fgetc (int filepointer) <? $fh = fopen("data.txt", "r"); while (! feof($fh)) : $char = fgetc($fh); print $char; endwhile; fclose($fh); ?>