Reads a character from a file.
fgetc() returns a string with a character from the specified file. If EOF has been reached, FALSE is returned.
<?php
$filename = "log.txt";
$logfile = fopen($filename, "r");
$char = fgetc($logfile);
print "First character of $filename is: $char";
?> First character of log.txt is: S This code reads and prints a character from a file.