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
- Upside Down House in Germany
- Creating directories in php with mkdir()
ashesh Recommends
- A Site With A Little Bit For Everyone (figurethingsout.com)
- Profit With A Social Networking Blog (WinsonYeung)

