Ma perche' on usate la funziona scandir???????
C'e' e' bella funziona perfettamente e vi evita di scrivere parecchio codice.
es
Et voila' una cosi' o cmq similare.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 ;
}

Rispondi quotando