PHP rmdir() Function

In the rmdir() function is used to remove an folder from server and it returns two outputs that's are TRUE and FALSE .TRUE means success and FALSE means failure.

Demo :



New Directory Name :  
       
Folder inside have 3 files available thats are :
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 
delete

 

Example :

In the above demo is used to an create and delete folder from server. Just you type folder name(directory name) on the text box and click create button and see below of new folder.

If you need to delete folder you click near of have delete button that ask "are you sure you want to delete this folder" and then click ok button the folder will be deleted from server otherwise if you click cancel button which folder can not delete from server.

Code :

Following code is use to rmdir functions if you need code to copy and use to your website.


<?php
  $Folder_name = "Folder Name";
  rmdir($Folder_name);
  echo "Folder has been remove successfully...";
?>

In the above $Folder_name variable is used to assign to want delete folder and rmdir() function is used to remove folder (delete directory) from server and after will be displayed "Folder has been remove successfully..." message.

Free Download Script :

If you need to rmdir() function code click and download from following link.

Download




Content