Removing folders with files (PHP)

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?

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)

Thanks Jubba, that page with all the functions will come in handy.