Originariamente inviato da marketto
http://forum.html.it/forum/showthrea...hreadid=691246





http://it2.php.net/dir
codice:
function make_tree($path){ //where $path is your source dir.
     $handle=opendir($path);
     while($a=readdir($handle)){
         if(!preg_match('/^\./',$a)){
               $full_path="$path/$a";
               $list[]=$full_path; // REPLACE WITH OPTION IF NEEDED.
               if(is_dir($full_path)){
                   $recursive=make_tree($full_path);
                   for($n=0; $n<count($recursive); $n++){
                         $list[]=$recursive[$n];
                   }
               }
         }
     }
     closedir($handle);
     return $list;
}
echo "<pre>\n";
$path=".......";
print_r(make_tree($path));
echo "</pre>";
Mi spiegheresti come fa a funzionare questa funzione?!