时间:2021-07-01 10:21:17 帮助过:28人阅读
php中可以通过rmdir()函数删除一个空目录
<?php
if (file_exists("/temp/test")) {
rmdir("/temp/test");
print("Directory removed.\n");
} else {
print("Directory does not exist.\n");
}
?>
上面的代码第一次执行会返回
Directory removed.
第二次执行,由于目录已经被删除,会返回
Directory does not exist.
希望本文所述对大家的php程序设计有所帮助。