What are the best practices for decoding or unpacking a string obtained from an HTTP response in PHP, particularly when dealing with gzip encoding?

When receiving a string from an HTTP response that is encoded with gzip, it needs to be decoded in order to properly read its contents. To decode a gzip-encoded string in PHP, you can use the `gzdecode()` function. This function will take the gzip-encoded string as input and return the decoded string.

// Assuming $response contains the gzip-encoded string obtained from the HTTP response
$decodedString = gzdecode($response);

// Now $decodedString contains the decoded contents of the gzip-encoded string
echo $decodedString;