deleting folders and files

kaits

Mitglied
Hi!

I have a folder named "documents" and it contains 2 folders:
"first" and "second" and there are some files in these folders.

How to get the list of folders in the documents folder, delete all files in all subfolders which are in documents folder and also delete all subfolders in documents folder and then finally delete the documents folder?

Feel free to answer in German :)
 
Just go in the first directory. list and unlink all files. its easy. If there is a directory do the same.

Just look http://www.php.net for the functions

dir and unlink

You will find usefull stuff in the User Contributed Notes.
 
Zurück