PHP: Hypertext Preprocessor (original) (raw)
`Example about to use deflate functions to write a gzip encoded file in chunks.
deflateContext=deflateinit(ZLIBENCODINGGZIP,[′level′=>9]);deflateContext = deflate_init(ZLIB_ENCODING_GZIP, ['level' => 9]);deflateContext=deflateinit(ZLIBENCODINGGZIP,[′level′=>9]);strings = [ 'Hello, how are you?' . PHP_EOL, 'I am fine thanks' . PHP_EOL, 'Hello, how are you?' . PHP_EOL, ]; foreach ( stringsasstrings as stringsasstring) { fwrite($handler, deflate_add($deflateContext, $string, ZLIB_NO_FLUSH)); }fwrite($handler, deflate_add($deflateContext, '', ZLIB_FINISH)); fclose($handler); echo gzdecode(file_get_contents('/tmp/test.csv')); `