gzencode
Description
Syntax
gzencode( string $data, int $level = -1, int $encoding = ZLIB_ENCODING_GZIP ): string|false
Parameters
data
The data to encode.
level
The level of compression.
Can be given as 0 for no compression up to 9 for maximum compression. If -1 is used, the default compression of the zlib library is used which is 6.
encoding
The encoding mode.
Constant | Description |
---|---|
ZLIB_ENCODING_RAW | DEFLATE algorithm as per RFC 1951. |
ZLIB_ENCODING_DEFLATE | ZLIB compression algorithm as per RFC 1950. |
ZLIB_ENCODING_GZIP | GZIP algorithm as per RFC 1952. |
Return
Returns the encoded string, or false if an error occurred.
Examples
1 · data
<? $data = "data"; $return = gzencode($data); echo $return; ?>
� KI,I c��