SimpleXML and Chinese

后端 未结 3 1860
余生分开走
余生分开走 2021-01-16 15:16

I\'m busy trying to process the following RSS feed: Yahoo Search RSS, using the following code once the data is fetched:

$response = simplexml_load_string($dat

3条回答
  •  一向
    一向 (楼主)
    2021-01-16 16:12

    I took a look here: Simplexml_load_string() fail to parse error And after doing what it says (

     $data = file_get_contents('http://tw.blog.search.yahoo.com/rss?ei=UTF-8&p=%E6%95%B8%E4%BD%8D%E6%99%82%E4%BB%A3%20%E9%9B%9C%E8%AA%8C&pvid=QAEnPXeg.ioIuO7iSzUg9wQIc1LBPk3uWh8ABnsa');
    
    $data = iconv("GB18030", "utf-8", $data);
    
    $response = simplexml_load_string($data);
    

    ) I can see the Chinese characters, but there is a parse error.

提交回复
热议问题