$zip = new ZipArchive();
$zip->open("archive.zip", ZIPARCHIVE::CREATE);
$zip->addFile("img/1.png", "1.png");
$zip->close();
header('Content-Disposition: attachment; filename="archive.zip"');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $file_zip . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file_zip));
if (ob_get_level()) ob_end_clean();
readfile($file_zip);
exit;