gzinflate()
gzinflate() — Inflate a deflated string.
Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
Signature
gzinflate(string $data, int $max_length = 0): string|false
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $data | string | The data compressed by gzdeflate(). |
| $max_length | int | The maximum length of decoded data. |
Return value
The original uncompressed data or false on error. The function will return an error if the uncompressed data is more than 32768 times the length of the compressed input data or, unless max_length is 0, more than the optional parameter max_length.
Example
A runnable snippet:
$compressed = gzdeflate('Compress me', 9); $uncompressed = gzinflate($compressed); echo $uncompressed;
See also
gzdeflate(), gzcompress(), gzuncompress(), gzencode()
All PHP 8.5 built-in functions
Reference card built from the PHP manual page gzinflate() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.