Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function getDirectory($path) {
- $dir = $files = array();
- $ite = new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS);
- foreach ( new RecursiveIteratorIterator($ite, RecursiveIteratorIterator::CHILD_FIRST) as $file ) {
- $file->isDir() ? $dir[] = "$file" : $files[] = "$file";
- }
- return array($dir,$files);
- }
- echo "<pre>";
- list($a,$b) = getDirectory(__DIR__);
- print_r ($a); // this will result the same as array $files_matched, it ok!
- print_r ($b); // but i don't know why I cannot get the array of $dir_matched??
- echo "</pre>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement