array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'en', ), 'this' => array ( 0 => 'function.rmdir.php', 1 => 'rmdir', ), 'up' => array ( 0 => 'ref.filesystem.php', 1 => 'Filesystem Functions', ), 'prev' => array ( 0 => 'function.rewind.php', 1 => 'rewind', ), 'next' => array ( 0 => 'function.set-file-buffer.php', 1 => 'set_file_buffer', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/filesystem/functions/rmdir.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
rmdir — Removes directory
Attempts to remove the directory named by directory
.
The directory must be empty, and the relevant permissions must permit this.
A E_WARNING
level error will be generated on failure.
Example #1 rmdir() example
<?php
if (!is_dir('examples')) {
mkdir('examples');
}
rmdir('examples');
?>