Codice PHP:
$files glob('path/to/temp/*'); // get all file names
foreach($files as $file){ // iterate files
  
if(is_file($file))
    
unlink($file); // delete file

ho trovato questa funzione, crea un array vero? e ciclicamente cancella tutti i files, no?