<?php
$zip = new ZipArchive();
$zip->open('archive1.zip', , ZIPARCHIVE::CREATE);
$files = scandir($papka); // $papka перем. с путэм к папке
foreach($files as $file){
if ($file == '.' || $file == '..' ){continue;}
$f = $papka.DIRECTORY_SEPARATOR.$file;
$zip->addFile($f);
}
$zip->close();