$path= "/dropdown/"; if(!is_dir($path)) { echo "improper directory"; } else { $zip = new ZipArchive; $zip->open('/file.zip', ZipArchive::CREATE); if (false !== ($dir = opendir($path))) { while (false !== ($file = readdir($dir))) { if ($file != '.' && $file != '..') { $zip->addFile($path.DIRECTORY_SEPARATOR.$file); } } } else { die('Can\'t read dir'); } $zip->close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)