Skip to content

Instantly share code, notes, and snippets.

@ulrischa
Last active January 4, 2016 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ulrischa/d882a146a1e3faafc0dd to your computer and use it in GitHub Desktop.
Save ulrischa/d882a146a1e3faafc0dd to your computer and use it in GitHub Desktop.
Php flat directory tree
<?
$iterator = new RecursiveDirectoryIterator ('rootdir');
$wrapper = new RecursiveIteratorIterator ($iterator, RecursiveIteratorIterator::SELF_FIRST);
foreach ($wrapper as $elem) {
echo $elem->getFilename ();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment