You can write a script in PHP that will make you to creat zip file so that you can zip and unzip files through the same. Here's the URL for script written in PHP that will explain to you how to create ZIP files on the fly using PHP.
if it's for your own internal use it should be just fine. For files that people are going to be downloading I would seriously look into running another program from php. Any homemade zipper (such as that script though it is cool) is likely to produce compatibility problems somewhere.