[PHP]删除目录
时间:2007-07-14 来源:neka
function deldir($path){
if (file_exists($path)){
if(is_file($path)){
@unlink($path);
} else{
$handle = opendir($path);
while ($file = readdir($handle)) {
if (($file!=".") && ($file!="..") && ($file!="")){
if (is_dir("$path/$file")){
deldir("$path/$file");
} else{
@unlink("$path/$file");
}
}
}
closedir($handle);
@rmdir($path);
}
}
}
相关阅读 更多 +
排行榜 更多 +