Mar 23, 2010
Zip with PhpEvery time when you search for the code "How to create zip file with php" OR "Zipping with Php", You will easily found a class or a long code snippet. I think If your are searching for the basic idea, You are at right place.
<?php $zip = new ZipArchive(); // use ZIPARCHIVE::OVERWRITE if you want to owerwrite files $zip->open('my.zip',ZIPARCHIVE::CREATE); // add file names, comma separated $zip->addFile('file1.txt','file2.php'); $zip->close(); ?>
If anything helps, feel free to buy me a beer.
By : Motyar+ @motyar