php关于ob_gzhandler和gzencode()
前一段时间要搞一个gzip压缩输出,想着在文件里用ob_start('gz_handler');结果客户端始终打不开。
改成gzencode($data, 5); 之后能正常打开。
ob_gzhandler — 在ob_start中使用的用来压缩输出缓冲区中内容的回调函数。
gzencode — 创建gzip压缩字符串
gzencode ( string $data
[, int $level
= -1 [, int $encoding_mode
= FORCE_GZIP ]] )
This function returns a compressed version of the input data
compatible with the output of the gzip program.
标签: php压缩输出