|
SplFileObject::currentRetrieve current line of file Beschreibung
public string|array SplFileObject::current
( void
)
Retrieves the current line of the file. Parameter-ListeDiese Funktion hat keine Parameter. Rückgabewerte
Retrieves the current line of the file. If the Beispiele
Beispiel #1 SplFileObject::current example
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
1: <?php
2: $file = new SplFileObject(__FILE__);
3: foreach ($file as $line) {
4: echo ($file->key() + 1) . ': ' . $file->current();
5: }
6: ?>
Siehe auch
|