Home > Backend Development > PHP Problem > How to solve php curl garbled problem

How to solve php curl garbled problem

藏色散人
Release: 2023-03-07 14:36:01
Original
2626 people have browsed it

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");".

How to solve php curl garbled problem

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

How to solve php curl garbled problem

Solution

Specify the request header Accept-Encoding: gzip, deflate

Code

curl_setopt($ch, CURLOPT_ACCEPT_ENCODING, "gzip,deflate");
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template