(PHP 4, PHP 5, PHP 7, PHP 8)
rmdir — 删除目录
$directory, ?resource $context = null): bool
尝试删除 directory 所指定的目录。
该目录必须是空的,而且要有相应的权限。
失败时会产生一个 E_WARNING 级别的错误。
成功时返回 true, 或者在失败时返回 false。
示例 #1 rmdir() 例子
<?php
if (!is_dir('examples')) {
mkdir('examples');
}
rmdir('examples');
?>