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

User Contributed Notes
There are no user contributed notes for this page.