gzencode

(PHP 4 >= 4.0.4)

gzencode -- Create a gzip compressed string

Description

string gzencode ( string data [, int level])

This function returns a compressed version of the input data compatible with the output of the gzip program, or FALSE if an error is encountered. The optional parameter level can be given as 0 for no compression up to 9 for maximum compression, if not given the default compression level will be 1.

The resulting data contains the appropriate headers and data structure to make a standard .gz file, e.g.:

For more information on the GZIP file format, see the document: GZIP file format specification version 4.3 (RFC 1952).

See also gzcompress(). gzuncompress(), gzdeflate(), gzinflate().