Create a zip file
This uses the Pclzip library. This is a nice easy way to create a zip file, in the example belowwe backup our images folder to a file called backup.zip . This is an ideal example of how this could be used .
<?php
//download library from http://www.phpconcept.net/pclzip/index.en.php#download
include('pclzip.lib.php');
//zip file name
$new_zip= new PclZip('backup.zip');
//backup theimages folder
$file_list = $new_zip->create('images/');
if ($file_list == 0)
{
die("Error : ".$new_zip->errorInfo(true));
}
echo "Successfully created zip file";
?>