gzip_decompress_from_base64_string()
Learn how to use the gzip_decompress_from_base64_string() function to decode an input string from base64 and perform a gzip-decompression.
Decodes the input string from base64 and performs gzip decompression.
Syntax
gzip_decompress_from_base64_string(string)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| string | string | ✔️ | The value that was compressed with gzip and then base64-encoded. The function accepts only one argument. |
Returns
- Returns a UTF-8
stringthat represents the original string. - Returns an empty result if decompression or decoding failed.
- For example, invalid gzip-compressed and base 64-encoded strings will return an empty output.
Examples
Valid input
print res=gzip_decompress_from_base64_string("H4sIAAAAAAAA/wEUAOv/MTIzNDU2Nzg5MHF3ZXJ0eXVpb3A6m7f2FAAAAA==")
| res |
|---|
| “1234567890qwertyuiop” |
Invalid input
print res=gzip_decompress_from_base64_string("x0x0x0")
| res |
|---|
Related content
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.