CURL Returning Strange Characters CURL Returning Strange Characters curl curl

CURL Returning Strange Characters


I need the output in standard text, is that compressed or something?

Yes, exactly that: it's gzip-compressed. Your options are
a) decompress it using e.g. gzdecode
b) tell the server you don't want a gzip-encoded response; the easiest way is to let curl handle this for you:

  1. delete 'Accept-Encoding: gzip, deflate', from your header array
  2. Add: curl_setopt($ch, CURLOPT_ENCODING, 'identity'); somewhere before you curl_exec()