}
//删除根据目录删除子文件
function dir_del($dirpath){
$dh=opendir($dirpath);
while (($file=readdir($dh))!==false) {
if($file!="." && $file!="..") {
$fullpath=$dirpath."/".$file;
if(!is_dir($fullpath)) {
unlink($fullpath);
} else {
dir_del($fullpath);
@rmdir($fullpath);
}
}
}
closedir($dh);
$isEmpty = true;
$dh=opendir($dirpath);
dirpath | /home/xhrcwqxnh6rtcdw/wwwroot/caches/temp/ |
dh | Resource |
file | 0255cb9772949f9ead21ea8c72b9ec99.php |
fullpath | /home/xhrcwqxnh6rtcdw/wwwroot/caches/temp//0255cb9772949f9ead21ea8c72b9ec99.php |