All pastes #131507 Raw Edit

A-L-P-H-A

public text v1 · immutable
#131507 ·published 2006-08-14 15:13 UTC
rendered paste body
<?php
function parse_dir($dir) {
   if ($dh = @opendir($dir)) {
       while(($file = readdir($dh)) !== false) {
           if( !preg_match('/^\./s', $file) )  {
               if(is_dir($dir.$file)) {
                   $newdir = $dir.$file.'/'; // <- tailing slash
                   chdir($newdir);
                   echo "IS DIR: $newdir<br/>\n";
                   echo parse_dir($newdir);
               }
           }           
       }
       chdir('..');
   }
}
parse_dir('e:/uploads/');
?>