If you want to create a Zip Archieve, you can use the following example which demonstrates how to create a Zip Archieve :
PHP Code:
<?php
$zip = new ZipArchive ();
$filename = "./demo.zip" ;
if ( $zip -> open ( $filename , ZIPARCHIVE :: CREATE )!== TRUE ) {
exit( "Impossible d'ouvrir < $filename >\n" );
}
$zip -> addFromString ( "demofilephp.txt" . time (),
$zip -> addFromString ( "demofilephp2.txt" . time (),
$zip -> addFile ( $thisdir . "/too.php" , "/demofromfile.php" );
echo "Name of Files : " . $zip -> numFiles . "\n" ;
echo "status :" . $zip -> status . "\n" ;
$zip -> close ();
?>
Bookmarks