To delete a file, or a folder and its contents i have compiled a recursive algorithm.
Hope this will be useful for all of you.
read()) {
// Skip pointers
if ($entry == '.' || $entry == '..') {
continue;
}
// Recurse
rmdirr($dirname . DIRECTORY_SEPARATOR . $entry);
}
// Clean up
$dir->close();
return rmdir($dirname);
}
?>