Home > Article > Backend Development > How to solve php curl garbled problem
php curl garbled solution: first open the corresponding code file; then specify the request header, code such as "curl_setopt($ch, CURLOPT_ACCEPT_ENCODING, "gzip,deflate");".
Recommended: "PHP Video Tutorial"
PHP CURL collection garbled code solution
Problem description
Use a browser to open the web page, and it displays normally. Using PHP CURL to collect, all returned are some garbled blocks. Beginning with isG
Solution
Specify the request header Accept-Encoding: gzip, deflate
Code
curl_setopt($ch, CURLOPT_ACCEPT_ENCODING, "gzip,deflate");
Problem Solving
The above is the detailed content of How to solve php curl garbled problem. For more information, please follow other related articles on the PHP Chinese website!