时间:2021-07-01 10:21:17 帮助过:2人阅读
<?php
function cleanup_directory($dir) {
foreach (new DirectoryIterator($dir) as $file) {
if ($file->isDir()) {
if (! $file->isDot()) {
cleanup_directory($file->getPathname());
}
} else {
unlink($file->getPathname());
}
}
rmdir($dir);
}
?>
希望本文所述对大家的php程序设计有所帮助。