php关于ob_gzhandler和gzencode()

2019-10-22 Stone PHP

前一段时间要搞一个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压缩输出

评论(0) 浏览(1070)

Copyright © 2019 by 海角孤星 京ICP备15056837号-1