
Just use the following php code to delete all the files in a directory.
$dirpath= '[dirname]';
if ($handle = @opendir($dirpath)) {
while (false !== ($file = @readdir($handle))) { if ($file != '.' and $file != '..') { echo $file . ' deleted.'; @unlink($dirpath . '/' . $file); } } @closedir($handle);
}
No related posts.




One Response
Hello This is a great blog keep your good work and thank you for hvar in with me So nice to hear frome you.Thanks!