SplFileObject::eof

(PHP 5 >= 5.1.0, PHP 7)

SplFileObject::eofReached end of file

Opis

public SplFileObject::eof ( void ) : bool

Determine whether the end of file has been reached

Parametry

Ta funkcja nie posiada parametrów.

Zwracane wartości

Returns TRUE if file is at EOF, FALSE otherwise.

Przykłady

Przykład #1 SplFileObject::eof() example

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

Powyższy przykład wyświetli coś podobnego do:

apple
banana
cherry
date
elderberry

Zobacz też:

add a note add a note

User Contributed Notes

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