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 — Read entry from directory handle
Version | Description |
---|---|
8.0.0 | No parameter is accepted. Previously, a directory handle could be passed as argument. |
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.