开发者

get curl respone encoding

开发者 https://www.devze.com 2023-03-04 12:27 出处:网络
I\'m using cURL to retrieve a webpage. What\'s the easiest way to get encoding of 开发者_如何学Gothe page?

I'm using cURL to retrieve a webpage.

What's the easiest way to get encoding of 开发者_如何学Gothe page?

Of course I can parse response header to get charset, but I wonder if there is a better way.


Imo the most efficient way in this case will be:

$sContentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
0

精彩评论

暂无评论...
验证码 换一张
取 消