CURL Chinese garbled characters & lt ;? Php $ url & nbsp; = & nbsp; "http://www.gewara.com/cinema/ajax/getCinemaPlayItem.xhtml? Cid = 64915153 & amp; mid = & amp; fyrq = 2013-01-24 "; $ ch = & nbsp; curl_in CURL Chinese garbled characters
$ Url = "http://www.gewara.com/cinema/ajax/getCinemaPlayItem.xhtml? Cid = 64915153 & mid = & fyrq = ";
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, $ url );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 0 );
Curl_exec ($ ch );
Curl_close ($ ch );
?>
$ Adjust the url time to the current day or tomorrow ~ Why is it garbled?
Curl url php
------ Solution --------------------
Header ("content-type: text/html; charset = utf-8"); // specify the lower character set
------ Solution --------------------
You have reversed it!
Yes
$ Contents = mb_convert_encoding ($ contents, "gb2312", "UTF-8 ");
No
$ Contents = mb_convert_encoding ($ contents, "UTF-8", "gb2312 ");