zlib_get_coding_type

(PHP 4 >= 4.3.2, PHP 5, PHP 7, PHP 8)

zlib_get_coding_type — Returns the coding type used for output compression

Description

function zlib_get_coding_type(): string|false

Returns the coding type used for output compression. It is chosen from the Accept-Encoding request header: when zlib.output_compression is enabled (at request start or with ini_set()), or the first time ob_gzhandler() runs.

Parameters

This function has no parameters.

Return Values

Returns "gzip" if the Accept-Encoding request header contains gzip, otherwise "deflate" if it contains deflate. Returns false if no coding type has been chosen yet, for instance because output compression is not enabled or the header contains neither.

See Also