PHP curl returning strange characters

后端 未结 1 2116
长情又很酷
长情又很酷 2021-02-14 22:59

I am trying to update a page with image products of a Prestashop instance.

I am getting the information using prestashop web services. The problem is when I load the pag

相关标签:
1条回答
  • 2021-02-14 23:18

    Those strange data on response are the compressed content which your curl failed to detect.

    Replace this:

    curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate,sdch');
    

    With:

    curl_setopt($ch, CURLOPT_ENCODING, '');
    

    Empty encoding means to handle any type of encoding. It should solve your issue.

    0 讨论(0)
提交回复
热议问题