Last active
May 14, 2019 23:34
-
-
Save ardzz/a6e64e0dac58d8647bb367a16ed47666 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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