Skip to content

Instantly share code, notes, and snippets.

@ardzz
Last active May 14, 2019 23:34
Show Gist options
  • Save ardzz/a6e64e0dac58d8647bb367a16ed47666 to your computer and use it in GitHub Desktop.
Save ardzz/a6e64e0dac58d8647bb367a16ed47666 to your computer and use it in GitHub Desktop.
<?php
$path = __DIR__; // change this
$rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
$files = array();
$dir = array();
foreach ($rii as $file) {
if ($file->isDir()){
$dir[] = $file->getPathname();
continue;
}
$files[] = $file->getPathname();
}
print_r(array("dir" => $dir, "files" => $files));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment