}
//删除根据目录删除子文件
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/chuanglian1ic3hfura9n9gnl0isahn41/wwwroot/caches/temp/ |
dh | Resource |
file | 3c47d9cc9aa6c80c9cd9f5d1164ad667.php |
fullpath | /home/chuanglian1ic3hfura9n9gnl0isahn41/wwwroot/caches/temp//3c47d9cc9aa6c80c9cd9f5d1164ad667.php |