Skip to content

Instantly share code, notes, and snippets.

@christeredvartsen
Created January 28, 2011 17:54
Show Gist options
  • Save christeredvartsen/800646 to your computer and use it in GitHub Desktop.
Save christeredvartsen/800646 to your computer and use it in GitHub Desktop.
Traverse some directory
<?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