PHP rmdir() Function – Remove Directory

PHP rmdir() Function

Remove Directory in PHP

The rmdir() function is used to remove a directory from computer system.

rmdir() function syntax




rmdir() function Example




Above example we use rmdir() function to remove directory named with “meera” from computer system at php script folder.

PHP form script example to remove directory

<title>Remove Directory in PHP</title>
<FORM method="POST">
 Enter Directory Name : <input type="text" name="str"> <br/> <br/>
<input type="submit" name="Submit1" value="Remove Directory">

 echo "Directory Removed.";

The output of remove directory using rmdir() php example is:

php directory function
PHP rmdir() function example for remove directory


Leave a Reply

Your email address will not be published. Required fields are marked *