|
PHP5中文手册
Zlib Compression Functions简介This module enables you to transparently read and write gzip (.gz) compressed files, through versions of most of the filesystem functions which work with gzip-compressed files (and uncompressed files, too, but not with sockets).
需求This module uses the functions of » zlib by Jean-loup Gailly and Mark Adler. You have to use a zlib version >= 1.0.9 with this module. 安装Zlib support in PHP is not enabled by default. You will need to configure PHP --with-zlib[=DIR] PHP 的 Windows 版本已经内置该扩展模块的支持。无需加载任何附加扩展库即可使用这些函数。
运行时配置这些函数的行为受 php.ini 的影响。 The zlib extension offers the option to transparently compress your pages on-the-fly, if the requesting browser supports this. Therefore there are three options in the configuration file php.ini.
以下是配置选项的简要解释。
资源类型This extension defines a file pointer resource returned by gzopen(). 预定义常量以下常量由本扩展模块定义,因此只有在本扩展模块被编译到 PHP 中,或者在运行时被动态加载后才有效。 范例This example opens a temporary file and writes a test string to it, then it prints out the content of this file twice. Example#1 Small Zlib Example
<?php Table of Contents
|