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

gzdecode

Description

The gzdecode of zlib for PHP decodes a gzip compressed string.

Syntax

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

Parameters

data

The data to decode, encoded by gzencode().

max_length

The maximum length of data to decode.

Return

Returns the decoded string, or or false on failure.

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

<?

$gzencodedata = "data";

$data = gzencode($gzencodedata);

echo $data . PHP_EOL;

$return = gzdecode($data);

echo $return;

?>
�KI,Ic��
data

2 · max_length

<?

$gzencodedata = "data";

$data = gzencode($gzencodedata);

echo $data . PHP_EOL;

$max_length = 2;

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

var_export($return);

?>
�KI,Ic��
false
HomeMenu