Delete all files and folders in specified paths
Delete all files and directories in specified path recursively.
Copy this code and paste it in your HTML
// delete all folder contents recursive
function delDirContents($dir) {
$files = glob($dir . '/*', GLOB_MARK
);
foreach($files as $file)
{
delDirContents($file);
} else {
}
}
}
Report this snippet
Comments
Subscribe to comments