Click to See Complete Forum and Search --> : Wanna Zip? Just this 4 line of code helps you


hasin
01-29-2005, 01:45 AM
Hi,
Many of you want and need to create zip files with PHP. There are many
libraries around there. Recently I got a library named zip.lib.php. This file is used in many popular PHP projects like PHPMyAdmin, SiteBar etc. This library was created by someone else I dont know. But its interface its a bit noisy. So I extend that class and make it
really flexible for you all.

I hope you would enjoy. Just download the library from here.

http://solutionmaker.info/ZipLib.zip

The above file contains the original class file and example of usage.
However I reapet the usage to show how easy is creating a zip file
with it.

<?
include("zip.lib.php");
$ziper = new zipfile();
$ziper->addFiles(array("mypdf.pdf","file.png")); //array of files
$ziper->output("myzip.zip");
?>

Thats it. The zip is created and there is no hassle at all.

Thanks
--BinaryMan
www.hasinme.info

Join PHPExperts Group for fantastic Messages.

http://groups.yahoo.com/group/phpexperts

sineld
11-25-2006, 06:26 AM
great work! thanks!

ClarkF1
11-25-2006, 08:39 AM
The link doesn't work