Ma perche' on usate la funziona scandir???????

C'e' e' bella funziona perfettamente e vi evita di scrivere parecchio codice.

es

Codice PHP:

function dirExplorer$path $step $stepLimit )
{
     
// CASI BASE
     
if( !file_exists($path) )
          return 
"" ;
     if ( !
is_dir($path) )
          return 
"$path";
     if( 
$step>$stepLimit )
          return 
"recursion limit reached" ;

     
// RICORSIONE
     
$datas scandir($path) ;

     foreach( 
$datas as $r )
     {
          
$str .= dirExplorer$path."/".$r , ++$step $stepLimit ) ;
     }
     return 
$str ;

Et voila' una cosi' o cmq similare.