($days * 24 * 60 * 60)) { // Delete the file unlink($filePath); $deleted_files++; } } } } // Close the directory handle closedir($handle); } return $deleted_files; } ?>