function getdir($path){
$dir = opendir($path);
while(($file = readdir($dir)) == true){
//不让.和..出现在读取出的列表里
if($file == '.' || $file == '..'){
continue;
}
echo $file.'<br />';
//判断如果是目录,继续读取
if(is_dir($path.'/'.$file)){
echo "ppppldld";
getdir($path.'/'.$file);
}
}
}
$path = '/data/backup';
getdir($path);
$dir = opendir($path);
while(($file = readdir($dir)) == true){
//不让.和..出现在读取出的列表里
if($file == '.' || $file == '..'){
continue;
}
echo $file.'<br />';
//判断如果是目录,继续读取
if(is_dir($path.'/'.$file)){
echo "ppppldld";
getdir($path.'/'.$file);
}
}
}
$path = '/data/backup';
getdir($path);