open($zip_name, ZipArchive::CREATE); foreach($_SESSION['index'] as $path) { if (!str_ends_with($path, '.del')) { $path = $path . '.md'; if (file_exists($path)) { $zip->addFile($path, basename($path)); } } } $zip->close(); header('Content-disposition: attachment; filename=' . $zip_name); header('Content-type: application/zip'); readfile($zip_name); unlink($zip_name); } if (isset($_GET['download'])) { downloadall(); exit; } $filter = ''; if (isset($_GET['filter'])) { $filter = $_GET['filter']; } ?>