zlib_encode Correspondence between gzCompress, gzEncode and gzDeflate – PHP

The correspondence between these functions and zlib_decode is as follows:

  •  gzcompress ~ zlib_encode($str, ZLIB_ENCODING_DEFLATE)
  •  gzencode ~ zlib_encode($str, ZLIB_ENCODING_GZIP)
  •  gzdeflate ~ zlib_encode($str, ZLIB_ENCODING_RAW)

zlib_encode — Compress data with the specified encoding

gzencode — Create a gzip compressed string

gzdeflate — Deflate a string

gzcompress — Compress a string

byrev Written by:

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *