how to remove directory delete directories wiht PHP code

RegisterLogin
how to remove directory delete directories wiht PHP code
Post Description: how to remove directory delete directories wiht PHP code
Tags: how, to, remove, directory, delete, directories, wiht, PHP, code
This Post Was Posted On Feb 29, 2008 By web hosting #1325
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';
}
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2011 Webune Forums - Sat Dec 24, 2011 4:05 am
Powered by: Webune Forums V3