How to unzip a GZIP standard compressed string in PHP?

Asked

Viewed 185 times

1

Precise unzip a string compressed in GZIP standard in PHP. The field type is base64Binary.

I’ve tried to: gzinflate($string); gzdecode($string); gzuncompress($string);

But I only had return of "data error" in the use of the three functions.
How could I solve this problem?

1 answer

2


If the field is base64Binary (probably a webservice, SOAP maybe) so have to use base64_decode and then gzdecode, something like:

$string = base64_decode($string);
$string = gzdecode($string);

var_dump($string); //Para testar o resultado

Browser other questions tagged

You are not signed in. Login or sign up in order to post.