O'Reilly logo

PHP Advanced for the World Wide Web: Visual QuickPro Guide by Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Compressing Files with PHP

Most users are familiar with client-based GUI compression utilities such as WinZip or StuffIt, which will compress and decompress files. Thanks to the zlib, available from www.gzip.org/zlib (Figure 8.6), you can have PHP automatically compress files as well. The zlib library was written by two of the major compression/decompression developers as a patent-free, lossless data-compression tool. Zlib is available on every major platform (even for Palm handhelds!) and is frequently built into a server's configuration. I would be surprised if a Unix-brand of operating system did not include zlib, and you can use a Dynamic Link Library (DLL) version of the library on Windows.

Figure 8.6. The zlib library adds compression capability ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required