PDA

View Full Version : Removing folders with files (PHP)



Danneman
July 16th, 2003, 07:49 PM
I used...

rmdir($FOLDER);

...to remove a folder from the server.

However, it will only work when the folder is empty (ie. no files in it). And it doesnt matter if all the files have 777-permission (read-write-execute for all).

Is there a command that will delete the folder and all its content without having to go trough an exhausting "search-all-the-files-in-the-folder-and-delete-them" algortihm?

Jubba
July 16th, 2003, 07:56 PM
http://us3.php.net/manual/en/function.rmdir.php

more reading on rmdir

and read the posts at the bottom. They will show you codes that will delete the entire directory (empty or not)

Danneman
July 17th, 2003, 03:28 PM
Thanks Jubba, that page with all the functions will come in handy.