SplFileObject::eof

(PHP 5 >= 5.1.0)

SplFileObject::eofReached end of file

Beskrivelse

public bool SplFileObject::eof ( void )

Determine whether the end of file has been reached

Parametre

This function has no parameters.

Returnerings Værdier

Returns TRUE if file is at EOF, FALSE otherwise.

Eksempler

Eksempel #1 SplFileObject::eof() example

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

The above example will output something similar to:

apple
banana
cherry
date
elderberry

Se også

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top