Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gzopen(3) [php man page]

GZOPEN(3)								 1								 GZOPEN(3)

gzopen - Open gz-file

SYNOPSIS
resource gzopen (string $filename, string $mode, [int $use_include_path]) DESCRIPTION
Opens a gzip (.gz) file for reading or writing. gzopen(3) can be used to read a file which is not in gzip format; in this case gzread(3) will directly read from the file without decom- pression. PARAMETERS
o $filename - The file name. o $mode - As in fopen(3) ( rb or wb) but can also include a compression level ( wb9) or a strategy: f for filtered data as in wb6f, h for Huffman only compression as in wb1h. (See the description of deflateInit2 in zlib.h for more information about the strategy param- eter.) o $use_include_path - You can set this optional parameter to 1, if you want to search for the file in the include_path too. RETURN VALUES
Returns a file pointer to the file opened, after that, everything you read from this file descriptor will be transparently decompressed and what you write gets compressed. If the open fails, the function returns FALSE. EXAMPLES
Example #1 gzopen(3) Example <?php $fp = gzopen("/tmp/file.gz", "r"); ?> SEE ALSO
gzclose(3). PHP Documentation Group GZOPEN(3)

Check Out this Related Man Page

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)
Man Page