downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

SplFileObject::fgetcsv> <SplFileObject::fflush
[edit] Last updated: Fri, 14 Jun 2013

view this page in

SplFileObject::fgetc

(PHP 5 >= 5.1.0)

SplFileObject::fgetcGets character from file

说明

public string SplFileObject::fgetc ( void )

Gets a character from the file.

参数

此函数没有参数。

返回值

Returns a string containing a single character read from the file or FALSE on EOF.

Warning

此函数可能返回布尔值 FALSE,但也可能返回等同于 FALSE 的非布尔值。请阅读 布尔类型章节以获取更多信息。应使用 === 运算符来测试此函数的返回值。

范例

Example #1 SplFileObject::fgetc() example

<?php
$file 
= new SplFileObject('file.txt');
while (
false !== ($char $file->fgetc())) {
    echo 
"$char\n";
}
?>

参见



add a note add a note User Contributed Notes SplFileObject::fgetc - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites