recursivedirectoryiterator only files code example
Example: recursivedirectoryiterator only files
$imagesList = array();
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator('images/')) as $filename) {
if ($filename->isDir()) continue;
$imagesList[] = str_replace("\\","/",$filename->getPathname());
}
print_r($imagesList);