[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);
?>
留言
張貼留言