$files = array('1.jpeg','2.txt','3.wav');
$zipname = 'file.zip';
$zip = new ZipArchive;
$zip->open($zipname, ZipArchive::CREATE);
foreach ($files as $file) {
$zip->addFile($file);
}
$zip->close();
// Make Zip name
$zipname = "one.zip";
// Make a zip file
$cmd = `zip -r $zipname *`;
exec($cmd);