PHP curl returning strange characters

后端 未结 1 1172
暖寄归人
暖寄归人 2021-02-14 22:32

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:32

    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)
提交回复
热议问题