(PHP 5 >= 5.1.0, PHP 7)
SplFileObject::fgetc — Gets character from file
Gets a character from the file.
此函数没有参数。
Returns a string containing a single character read from the file or FALSE
on EOF.
Example #1 SplFileObject::fgetc() example
<?php
$file = new SplFileObject('file.txt');
while (false !== ($char = $file->fgetc())) {
echo "$char\n";
}
?>