How To Remove Directory Delete Directories Wiht PHP Code
how to remove directory delete directories wiht php code
how, to, remove, directory, delete, directories, wiht, php, code
How To Remove Directory Delete Directories Wiht PHP Code
Post Description: how to remove directory delete directories wiht php code
POST# 484
Posted On: Fri Feb 29, 2008 12:01 pm
web hosting
Topic: How To Remove Directory Delete Directories Wiht PHP Code
deleting or removing directories or folders with php is simple

rmdir()


Removes directory

example, lets say i want to remove or delete a directory called images, this is how i would do it with php


$mydir = '/path/directory/images/';

rmdir($mydir);


thats it

but this would be a more practical use, first i want to check if the directory even exists:

$mydir = '/path/directory/images/';
if (is_dir($mydir)) {
rmdir($mydir);
} else {
echo $mydir.' does not exists';
}


No Repies
(0) Comments for How To Remove Directory Delete Directories Wiht PHP Code

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload