delete directory recursively.
loops through a directory and attempts to delete everything inside the directory before removing the directory itself.

WARNING - once you started this function it's done - no way to recover deleted files.
think twice before trying this out !

download options for directories / recursive directory delete

you can download the source as PHP file,

open the file as plain text in a new window or

get the code in a textarea to copy it.