该函数旨在作为回调传递给ob_start()
。它使用浏览器支持的压缩算法压缩输出缓冲区的内容并返回压缩内容。它还发送一个 HTTP 标头,指示使用了哪种压缩算法。
当用作回调时ob_start()
:
ob_start("ob_gzhandler");
单独使用时:
ob_gzhandler(buffer, phase);
Parameter | Description |
---|---|
buffer | The contents of the output buffer |
phase | A bitmask which may have any number of the following flags: PHP_OUTPUT_HANDLER_START - If the output buffer was just created PHP_OUTPUT_HANDLER_FLUSH - If the output buffer is currently being flushed PHP_OUTPUT_HANDLER_FINAL - If the output buffer will be deleted right after this operation |
返回值: | 返回包含压缩内容的字符串 |
---|---|
PHP 版本: | 4.0.4+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!