/ Published in: PHP

Like python's os.listdir
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$iterator = new DirectoryIterator($directory); foreach($iterator as $file) { $name = $file->getFilename(); if($name[0] != '.') { if($file->isDir()) { listdir($directory.'/'.$name, &$list, $name.'/'); } else { $list[] = $base.$name; } } } return $list; }
Comments
