Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

gzuncompress

Description

The gzuncompress of zlib for PHP uncompresses a compressed string.

Syntax

gzuncompress(
    string $data,
    int $max_length = 0
): string|false

Parameters

data

The data compressed by gzcompress().

max_length

The maximum length of data to decode.

Return

Returns the original uncompressed data or false on error.

Returns 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 max_length.

Examples

1 · data

<?

$gzcompressdata = "data";

$data = gzcompress($gzcompressdata);

echo $data . PHP_EOL;

$return = gzuncompress($data);

echo $return;

?>
x�KI,I�
data

2 · max_length

<?

$gzcompressdata = "data";

$data = gzcompress($gzcompressdata);

echo $data . PHP_EOL;

$max_length = 2;

$return = gzuncompress($data, $max_length);

var_export($return);

?>
x�KI,I�
false
HomeMenu