downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

DirectoryIterator::rewind> <DirectoryIterator::key
Last updated: Fri, 20 May 2011

view this page in

DirectoryIterator::next

(PHP 5)

DirectoryIterator::nextMove forward to next DirectoryIterator item

Descripción

public void DirectoryIterator::next ( void )

Move forward to the next DirectoryIterator item.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

No devuelve ningún valor.

Ejemplos

Example #1 DirectoryIterator::next() example

List the contents of a directory using a while loop.

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

El resultado del ejemplo sería algo similar a:

.
..
apple.jpg
banana.jpg
index.php
pear.jpg

Ver también



add a note add a note User Contributed Notes DirectoryIterator::next
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites