$cleanfileUrl = ROOT_PATH . 'public' . DS .'ttsaudio';
$opendir = opendir($cleanfileUrl);
while ($file=readdir($opendir)) {
if($file!="." && $file!="..") {
$fullpath=opendir($cleanfileUrl."/".$file);
while ($path_date = readdir($fullpath)){
if($path_date!="." && $path_date!="..") {
$audio_fullpath = $cleanfileUrl."/".$file.'/'.$path_date;
if(file_exists($audio_fullpath)){
unlink($audio_fullpath);
}
}
}
if(file_exists($cleanfileUrl."/".$file)){
rmdir($cleanfileUrl."/".$file);
}
}
}
closedir($opendir);
closedir($fullpath);
PHP删除文件下多层文件
最新推荐文章于 2021-03-28 17:11:12 发布