Deleting all files from a folder using PHP

directory Structure

myapp

........new/allimages or all data
index.php

Source code in : index.php

<?php
// get all file names
$files = glob('new/*');
// loop through files
foreach($files as $file){
  if(is_file($file)) {
    // delete file
    unlink($file);
  }
}

?>


EmoticonEmoticon