[php] use recursice to read all file in directory



<?

function open_dir($dir){

$d = dir($dir);

while($row = $d->read()){

if($row != '.' && $row != '..'){

$path = $dir.'/'.$row;

echo $path."\n";

if(is_dir($path)){

open_dir($path);

}


}

}
}

$dir = getcwd();

open_dir($dir);

?>

留言

這個網誌中的熱門文章

a005: Eva 的回家作業