You can zip individual files (not multiple files together) with this method:
These 2 extensions allow you to write "Zip"'d content to either a file, or to the output stream in a browser so the user could download that "file". Basically, you would read in your normal uncompressed files one at a time using fread() or something like that, and then run the compression, and output that data, along with the appropriate header() for Content-Type, etc, and the user would get the dynamically created file which they could "save" to their computer.
--> use bzcompress(), etc
--> use gzencode(), etc
NOTE: neither of these creates an actual .ZIP file... but they are both zip file formats which can be read by most popular zip programs, like WinZip.
Otherwise, if you must ZIP multiple files together, preserving the files, then the only option I see is to have your PHP script execute (via system(), exec() or the `` backtick operators) the server's zip command (in unix, something like "tar -zcvf stuff.tar.gz stuff.txt stuff2.doc"). This would create a temporary file, which you could then read in via the above zip libraries (using the xxread() functions) and then dump that output straight out to the browser (again with appropriate content-type headers). Then, when the script was done executing, you could have your PHP delete the temp file.