PHP.nl

deflate_init

deflate_init

Initialize an incremental deflate context

 **deflate_init** int $encoding  $options

Initializes an incremental deflate context using the specified . encoding

Note that the option here only sets the window size of the algorithm, differently from the zlib filters where the same parameter also sets the encoding to use; the encoding must be set with the parameter. window``encoding

Limitation: there is currently no way to set the header information on a GZIP compressed stream, which are set as follows: GZIP signature (); compression method ( == DEFLATE); 6 zero bytes; the operating system set to the current system ( = Windows, = Unix, etc.) \x1f\x8B``\x08``\x00``\x03

encoding One of the constants. ZLIB_ENCODING_*

options An associative array which may contain the following elements:

 `level`The compression level in range -1..9; defaults to -1.

memoryThe compression memory level in range 1..9; defaults to 8.

window The zlib window size (logarithmic) in range ..; defaults to . zlib changes a window size of to , and as of zlib 1.2.8 fails with a warning, if a window size of is requested for or . 8``15``15``8``9``8``ZLIB_ENCODING_RAW``ZLIB_ENCODING_GZIP

strategy One of , , , or (the default). ZLIB_FILTERED``ZLIB_HUFFMAN_ONLY``ZLIB_RLE``ZLIB_FIXED``ZLIB_DEFAULT_STRATEGY

dictionary A or an of of the preset dictionary (default: no preset dictionary). string``array``strings

Returns a deflate context resource () on success, return.falseforfailure. zlib.deflate

If an invalid option is passed to or the context couldn't be created, an error of level is generated. options``E_WARNING

deflate_add``inflate_init