Created
January 28, 2011 17:54
-
-
Save christeredvartsen/800646 to your computer and use it in GitHub Desktop.
Traverse some directory
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 | |
$path = '/some/dir'; | |
$dir = new RecursiveDirectoryIterator($path); | |
$iterator = new RecursiveIteratorIterator($dir); | |
foreach ($iterator as $entry) { | |
print($entry->getRealPath() . PHP_EOL); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment