//Function to delete all files in a folder and then the folder too..
function DeleteFolder($dir) {
$d = dir($dir);
while($entry = $d->read()) {
if ($entry!= "." && $entry!= "..") {
unlink($dir.$entry);
}
}
$d->close();
rmdir($dir);
}
//Usage
DeleteFolder("/uploads/");
No comments:
Post a Comment