inflate_add
Description
The inflate_add of zlib for PHP incrementally inflate encoded data.
Syntax
inflate_add( InflateContext $context, string $data, int $flush_mode = ZLIB_SYNC_FLUSH ): string|false
Parameters
context
A context created with inflate_init().
data
A chunk of compressed data.
flush_mode
One of ZLIB_BLOCK, ZLIB_NO_FLUSH, ZLIB_PARTIAL_FLUSH, ZLIB_SYNC_FLUSH (default), ZLIB_FULL_FLUSH, ZLIB_FINISH.
Normally, set ZLIB_NO_FLUSH to maximize compression and ZLIB_FINISH to terminate with the last chunk of data.
Return
Returns a chunk of uncompressed data, or false on failure.
Examples
1 · context data
<? $encoding = ZLIB_ENCODING_DEFLATE; $deflate_initcontext = deflate_init($encoding); $deflate_initdata = "data"; $deflate_initreturn = deflate_add($deflate_initcontext, $deflate_initdata); echo $deflate_initreturn . PHP_EOL; $context = inflate_init($encoding); $data = $deflate_initreturn; $return = inflate_add($context, $data); var_dump($return);
x�JI,I �� string(4) "data"