Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gzinflate(3) [php man page]

GZINFLATE(3)								 1							      GZINFLATE(3)

gzinflate - Inflate a deflated string

string gzinflate (string $data, [int $length]) DESCRIPTION
This function inflates a deflated string. PARAMETERS
o $data - The data compressed by gzdeflate(3). o $length - The maximum length of data to decode. RETURN VALUES
The original uncompressed data or FALSE on error. The function will return an error if the uncompressed data is more than 32768 times the length of the compressed input $data or more than the optional parameter $length. EXAMPLES
Example #1 gzinflate(3) example <?php $compressed = gzdeflate('Compress me', 9); $uncompressed = gzinflate($compressed); echo $uncompressed; ?> SEE ALSO
gzdeflate(3), gzcompress(3), gzuncompress(3), gzencode(3). PHP Documentation Group GZINFLATE(3)

Check Out this Related Man Page

GZENCODE(3)								 1							       GZENCODE(3)

gzencode - Create a gzip compressed string

string gzencode (string $data, [int $level = -1], [int $encoding_mode = FORCE_GZIP]) DESCRIPTION
This function returns a compressed version of the input $data compatible with the output of the gzip program. For more information on the GZIP file format, see the document: GZIP file format specification version 4.3 (RFC 1952). PARAMETERS
o $data - The data to encode. o $level - The level of compression. Can be given as 0 for no compression up to 9 for maximum compression. If not given, the default com- pression level will be the default compression level of the zlib library. o $encoding_mode - The encoding mode. Can be FORCE_GZIP (the default) or FORCE_DEFLATE. Prior to PHP 5.4.0, using FORCE_DEFLATE results in a stan- dard zlib deflated string (inclusive zlib headers) after a gzip file header but without the trailing crc32 checksum. In PHP 5.4.0 and later, FORCE_DEFLATE generates RFC 1950 compliant output, consisting of a zlib header, the deflated data, and an Adler check- sum. RETURN VALUES
The encoded string, or FALSE if an error occurred. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.4.0 | | | | | | | | | | FORCE_DEFLATE now generates RFC 1950 compliant | | | output. | | | | +--------+---------------------------------------------------+ EXAMPLES
The resulting data contains the appropriate headers and data structure to make a standard .gz file, e.g.: Example #1 Creating a gzip file <?php $data = implode("", file("bigfile.txt")); $gzdata = gzencode($data, 9); $fp = fopen("bigfile.txt.gz", "w"); fwrite($fp, $gzdata); fclose($fp); ?> SEE ALSO
gzdecode(3), gzdeflate(3), gzinflate(3), gzuncompress(3), gzcompress(3), ZLIB Compressed Data Format Specification (RFC 1950) . PHP Documentation Group GZENCODE(3)
Man Page

Featured Tech Videos