本人學PHP沒多久  無聊做個程序玩  雖然可以做到遍歷第一層子目錄  但再往下的就不會遍歷了 所以想請教一下  
麻煩各位前輩看看 謝謝以下為代碼:class changes{
var $name='';
var $ext = '';
var $path = '';
var $handle = '';
var $sun ='';

function getpath($path){
if(is_dir($path))
{
return $path;
}
return false;
} function renames($pathfile)
{
while(false!=$file=readdir($pathfile)){
if($file=='.'||$file=='..')continue;
if(is_dir($this->path.$file)){
$this->sun = $file.'/';
$underfile=opendir($this->path.$file);
$this->renames($underfile);
$this->sun ='';
continue;
} echo $this->path.$this->sun.$file.'<br/>';
}
} function getname(){

} function loads($path){
if($pathfile = opendir($path)){
return $pathfile;
}
return false;
}
}class run extends changes{
function todo($path){
if($this->getpath($path)){
$this->path=$path;
$pathfile = $this->loads($path);
//$this->pathfile = $pathfile;
return $pathfile;
}
return false;
}
}$change = new run();
$path = 'C:/KwDownload/';
$handle= $change->todo($path);
$change->renames($handle);
?>