php递归删除缓存文件
/**
* 递归删除缓存文件
* @param $dir 缓存文件路径
*/
public function delFileByDir($dir) {
$dh = opendir($dir);
while ($file = readdir($dh)) {
if ($file != "." && $file != "..") {
$fullpath = $dir . "/" . $file;
if (is_dir($fullpath)) {
$this->delFileByDir($fullpath);
} else {
unlink($fullpath);
}
}
}
closedir($dh);
} 相关推荐
大地飞鸿 2020-11-12
steeven 2020-11-10
Tips 2020-10-14
nongfusanquan0 2020-08-18
yedaoxiaodi 2020-07-26
夜晚00 2020-07-03
hanyujianke 2020-06-28
xhao 2020-06-28
清溪算法君老号 2020-06-27
pengkingli 2020-06-25
yishujixiaoxiao 2020-06-25
Masimaro 2020-06-21
清溪算法 2020-06-21
oXiaoChong 2020-06-20
RememberMePlease 2020-06-17
chaigang 2020-06-13