php man page for gzcompress

Query: gzcompress

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

GZCOMPRESS(3)								 1							     GZCOMPRESS(3)

gzcompress - Compress a string

SYNOPSIS
string gzcompress (string $data, [int $level = -1], [int $encoding = ZLIB_ENCODING_DEFLATE])
DESCRIPTION
This function compresses the given string using the ZLIB data format. For details on the ZLIB compression algorithm see the document "ZLIB Compressed Data Format Specification version 3.3" (RFC 1950). Note This is not the same as gzip compression, which includes some header data. See gzencode(3) for gzip compression.
PARAMETERS
o $data - The data to compress. o $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 com- pression of the zlib library is used which is 6. o $encoding - One of ZLIB_ENCODING_* constants.
RETURN VALUES
The compressed string or FALSE if an error occurred.
EXAMPLES
Example #1 gzcompress(3) example <?php $compressed = gzcompress('Compress me', 9); echo $compressed; ?>
CHANGELOG
+--------+-----------------------------+ |Version | | | | | | | Description | | | | +--------+-----------------------------+ | 5.4.0 | | | | | | | Added $encoding parameter. | | | | +--------+-----------------------------+
SEE ALSO
gzdeflate(3), gzinflate(3), gzuncompress(3), gzencode(3). PHP Documentation Group GZCOMPRESS(3)
Related Man Pages
zlib(3) - centos
ns_zlib(3aolserv) - debian
gzencode(3) - php
perlio::via::bzip2(3) - osx
gzdeflate(3) - php
Similar Topics in the Unix Linux Community
Compress in Unix
compression utilities
Compress.exe Question
How to avoid CR after compression
Adding gzip compression to a connection using nc