简体   繁体   中英

get curl respone encoding

I'm using cURL to retrieve a webpage.
What's the easiest way to get encoding of the page?

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

在这种情况下,Imo最有效的方法是:

$sContentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM