Possible Duplicate:
How do I recursively delete a directory and its entire contents (files+sub dirs) in PHP?
PHP: delete directory with files in it?
I am working with an site where I have to store four images of different formats by creating a directory in an specified folder. I have created the directory and inserted the images into it. Now my problem is I am unable to delete the directory with all the images.
Suppose I have,
$path = "offer_pic/";
$directory = $r2['shop_name'];
$realpath=$path.$directory.'/';
How do I delete all of the images inside $realpath
, as well as the directory itself ($directory
)?