// 删除指定目录下的全部文件
function deleteFolderFiles($dir) {
$dh = opendir($dir);
while ($file = readdir($dh)) {
if($file != "." && $file != "..") {
$fullpath = $dir."/".$file;
if(!is_dir($fullpath)) {
unlink($fullpath);
} else {
deleteFolderFiles($fullpath);
}
}
}
closedir($dh);
}