Php/docs/splfileobject.fgetc
来自菜鸟教程
SplFileObject::fgetc
(PHP 5 >= 5.1.0, PHP 7)
SplFileObject::fgetc — Gets character from file
说明
public SplFileObject::fgetc ( ) : string
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";}?>