Great Function...
#
But I had an issue with the rmdir($location.file) after the call to deldir
how bout
if (is_dir($location.$file))
rmdir($location.$file)
function deldir($location) {
if (substr($location,-1) <> "/")
$location = $location."/";
$all=opendir($location);
while ($file=readdir($all)) {
if (is_dir($location.$file) && $file <> ".." && $file <> ".") {
deldir($location.$file);
rmdir($location.$file);
print "Removed directory ($location$file)\n";
unset($file);
} elseif (!is_dir($location.$file)) {
unlink($location.$file);
print "Removed file ($location$file)\n";
unset($file);
}
}
if (rmdir($location))
return 1;
}