To create zip file

This code will create zip file including (all types of data including images or videos)
$zip1 = new ZipArchive();
$zipname_v =  'zipfilename_video';
$zipname_path_v = $_SERVER["DOCUMENT_ROOT"] . '/zipped/' . $zipname_v . '.zip';

$zip_created_v = $zip1->open($zipname_path_v, ZipArchive::CREATE | ZipArchive::OVERWRITE);
if ($zip_created_v === true) {
$video_tour = get_field('video_tour', $postID);//get custom field stored images/videos
//print_r($video_tour);die();
if (!empty($video_tour)) {
foreach ($video_tour as $videos) {
$video_file = $videos['video_tour']['url']; // store videos after get vidoes from acf.

if (!empty($video_file)) {
$download_file = str_replace("https://szybkapoczta.eu", get_home_path(), $video_file);
$zip1->addFile($download_file, basename($download_file));// add videos data in zip
}
}
}
$rerspond = $zip1->close();