should be something like this. Remember that the $dir directory must be 777 permission if you run it from HTTP!
$dir = "/path/to/images";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (preg_match('/^D001_image\
unlink($dir . "/" . $file);
}
closedir($dh);
}
}
Main Topics
Browse All Topics





by: RoonaanPosted on 2005-06-16 at 04:33:37ID: 14229862
Yes, you would use:
unlink'('D001_image.jpg');
I think you can figure out how to write the loop yourself?
-r-