Hi there,
I'm using the following function (from a devshed article) to delete a directory of images (depending on the group selected). It's not working though, and despite my trying to change a few things here and there I can't figure out what to do?
function purge($dir) {
$handle = opendir($dir);
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if (is_dir($dir.$file)) {
purge ($dir.$file."/");
rmdir($dir.$file);
}
else {
unlink($dir.$file);
}
}
}
closedir($handle);
}
purge("/services/web/mydomain.com/public/images/200/");
If someone can suggest what I'm doing wrong?
thanks for any tips...