PHP 8.3.4 Released!

SplFileObject::eof

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

SplFileObject::eofReached end of file

Beschreibung

public SplFileObject::eof(): bool

Determine whether the end of file has been reached

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

Returns true if file is at EOF, false otherwise.

Beispiele

Beispiel #1 SplFileObject::eof() example

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

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

apple
banana
cherry
date
elderberry

Siehe auch

add a note

User Contributed Notes

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