SplFileObject::eof
(PHP 5 >= 5.1.0)
SplFileObject::eof — Reached end of file
Descripción
public bool SplFileObject::eof
( void
)
Determine whether the end of file has been reached
Parámetros
Esta función no tiene parámetros.
Valores devueltos
Returns TRUE if file is at EOF, FALSE otherwise.
Ejemplos
Example #1 SplFileObject::eof() example
<?php
$file = new SplFileObject("fruits.txt");
while ( ! $file->eof()) {
echo $file->fgets();
}
?>
El resultado del ejemplo sería algo similar a:
apple banana cherry date elderberry
Ver también
- SplFileObject::valid() - Not at EOF
- feof() - Comprueba si el puntero a un archivo está al final del archivo
There are no user contributed notes for this page.
