PHP: How to compress a folder and download from server using php?

Following script was very helpful to me for compressing A folder (including all sub folders and files in it) using PHP: <?php $the_folder = ‘path/foldername’; $zip_file_name = ‘’; $download_file= true; //$delete_file_after_download= true; doesnt work!! class FlxZipArchive extends ZipArchive { /** Add a Dir with Files and Subdirs to the archive;;;;; @param string $location Real Location;;;; […]