"); $files = glob($dirName, 0); $count = 0; foreach ($files as $file) { $fileAgeInDays = (time() - filemtime($file)) / (3600 * 24); if ($fileAgeInDays > $days_to_remove) { if (unlink($file)) { echo($file . " " . $fileAgeInDays . "
"); $count = $count + 1; } } } echo("Deleted " . $count . " graphs"); ?>