use
while ($row=$dir->read()){
// your code
}
to get a list of all files and directories. You can definitely use the "for" and other loops.
(PHP 4, PHP 5, PHP 7)
Directory::read — Read entry from directory handle
$dir_handle
= ?
) : string
Same as readdir(), only
dir_handle
defaults to $this->handle.
use
while ($row=$dir->read()){
// your code
}
to get a list of all files and directories. You can definitely use the "for" and other loops.