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, PHP 8)
Directory::read — Lee una entrada desde el controlador de directorio
$dir_handle
= ?): string
Igual a readdir(),
dir_handle
por defecto $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.