You may want to have a look at
http://www.phpclasses.orgEspecially for the class names "Zip/Tar/GZip Archives"
Description:
Allows the creation of zip, tar, and gzip archives, and extraction of tar and gzip.
Supports relative paths/no paths, comments, and recursing through subdirectories.
Can write file to disk, allow user to download directly, or can return file contents in a string.
It doesn't require any external programs to run. PHP must be compiled with '--with-zlib' because gzcompress, gzdeflate, and gzinflate are used for gzip and zip files, but creation of tar files will work regardless of whether or not this option is set.
You'll have to register to download it, but it's free.
phpclasses.org is a great resource for all kind of php classes.