English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Filesystem Reference Manual
The rmdir() function can delete an empty directory and return true on success, and return false on failure.
bool rmdir ( string $dirname [, resource $context ] )
Try to delete the directory specified by dirname. The directory must be empty and have the corresponding permissions. An E_WARNING level error will be generated if it fails.
<?php if(!is_dir("/PhpProject/examples")) { mkdir("/PhpProject/examples"); } rmdir("/PhpProject/examples"); echo "The directory has been successfully deleted!!!"; ?>
Output Result
The directory has been successfully deleted!!!