Recursive Iterator

/ Published in: PHP
Save to your folder(s)

By requinix

Copy this code and paste it in your HTML
  1. $diriterator = new RecursiveDirectoryIterator("images");
  2. $iterator = new RecursiveIteratorIterator($diriterator, RecursiveIteratorIterator::SELF_FIRST);
  3. foreach ($iterator as $file) {
  4. if (strcasecmp(substr($file, -4), ".xml") == 0) echo $file, "\n";
  5. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.