Posted By

smoover on 08/05/09


Tagged

file recursive directory iterate


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


Recursive Iterator


 / Published in: PHP
 

URL: http://forums.devshed.com/php-development-5/need-help-implementing-custom-class-629622.html

By requinix

  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  

You need to login to post a comment.