PHP Doku:: Move to the next file - filesystemiterator.next.html

Verlauf / Chronik / History: (5) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige GrunderweiterungenStandard PHP Library (SPL)IteratorenThe FilesystemIterator classFilesystemIterator::next

Ein Service von Reinhard Neidl - Webprogrammierung.

The FilesystemIterator class

<<FilesystemIterator::key

FilesystemIterator::rewind>>

FilesystemIterator::next

(PHP 5 >= 5.3.0)

FilesystemIterator::nextMove to the next file

Beschreibung

public void FilesystemIterator::next ( void )

Move to the next file.

Parameter-Liste

Diese Funktion hat keine Parameter.

Rückgabewerte

Es wird kein Wert zurückgegeben.

Beispiele

Beispiel #1 FilesystemIterator::next() example

List the contents of a directory using a while loop.

<?php
$iterator 
= new FilesystemIterator(dirname(__FILE__));
while(
$iterator->valid()) {
    echo 
$iterator->getFilename() . "\n";
    
$iterator->next();
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

apple.jpg
banana.jpg
example.php

Siehe auch


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)