Created
February 24, 2016 13:04
-
-
Save zhukovsergei/54376c995304e0585249 to your computer and use it in GitHub Desktop.
Получаем все вложенные директории без рекурсии
This file contains 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 | |
$iterator = new RecursiveIteratorIterator( | |
new RecursiveDirectoryIterator('/home/nepster/www/test.ru'), | |
RecursiveIteratorIterator::SELF_FIRST); | |
foreach($iterator as $file) { | |
if($file->isDir()) { | |
echo $file->getRealpath(), PHP_EOL; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment