Removing a directory in php with rmdir()
The php function rmdir() enables developers to remove a directory from the file system. The process trying to delete the directory must have enough permissions and the directory must be empty. The rmdir() function requires a string representing the path to the directory to be deleted. It returns TRUE on success or FALSE on failure.
Example code:
rmdir( "mydir" );
<?php if (!is_dir('exampledir')) { mkdir('exampledir'); } rmdir('exampledir'); ?>
More From ashesh
- Wishing you a very happy Deepawali | Nepali Calendar | Nepali Unicode | Ashesh
- Upside Down House in Germany | Nepali Calendar | Nepali Unicode | Ashesh
- Creating directories in php with mkdir() | Nepali Calendar | Nepali Unicode | Ashesh
ashesh Recommends
- Building Social Applications using Zembly (craigsdickson)
- Firesale : Get HP TouchPad with a price cut of $300 or more (Sathiya seelan)


