Skip to content

Instantly share code, notes, and snippets.

@barlino
Created June 19, 2012 03:33
Show Gist options
  • Save barlino/2952146 to your computer and use it in GitHub Desktop.
Save barlino/2952146 to your computer and use it in GitHub Desktop.
use PHP5 for scanning directories recursively
<?
$dir = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator('/tmp'), true);
foreach ( $dir as $file ) {
echo str_repeat("--", $dir->getDepth()) . " $file\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment