DirectoryIterator::next

(PHP 5, PHP 7)

DirectoryIterator::nextMove forward to next DirectoryIterator item

˵��

public DirectoryIterator::next ( void ) : void

Move forward to the next DirectoryIterator item.

����

�˺���û�в�����

����ֵ

û�з���ֵ��

����

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();
}
?>

�������̵���������ڣ�

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

�μ�