View Single Post
  #1 (permalink)  
Old 09-02-05, 02:38 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
[SOLVED] Delete Folder with PHP?

Hi,
I'm writing on a PHP script which requires an installation. I've got all the installation files in the same folder, and I want to remove this folder after installing with a click on a link or button or something like that. Is that possible? I've been searching on Google a long time... without luck! I hope someone can help. Thanks in advance,

Nico

EDIT:

Since this topic gets a lot of views still, I'll post an example here:
PHP Code:


// Path to directory you want to delete
$directory 'directory';

// Delete it
if (rmdir($directory))
{
    echo 
"{$directory} has been deleted";
}
else
{
    echo 
"{$directory} could not be deleted";


Last edited by Nico; 01-18-09 at 12:28 PM.
Reply With Quote