SplFileObject::eof

(PHP 5 >= 5.1.0, PHP 7)

SplFileObject::eofReached end of file

˵��

public SplFileObject::eof ( void ) : bool

Determine whether the end of file has been reached

����

�˺���û�в�����

����ֵ

Returns TRUE if file is at EOF, FALSE otherwise.

����

Example #1 SplFileObject::eof() example

<?php
$file 
= new SplFileObject("fruits.txt");
while ( ! 
$file->eof()) {
    echo 
$file->fgets();
}
?>

�������̵���������ڣ�

apple
banana
cherry
date
elderberry

�μ�