【发布时间】:2011-02-24 07:53:45
【问题描述】:
我做到了
<blink>
$xml = file_get_contents(http://weather.yahooapis.com/forecastrss?w=12797541);
$yahoo_response = new SimpleXMLElement($xml , 0, true);
</blink>
我收到了这样的 XML 解析警告:
PHP Warning: SimpleXMLElement::__construct()
[<a href='simplexmlelement.--construct'>simplexmlelement.--construct</a>]:
I/O warning : failed to load external entity "<?xml version="1.0"
.....
消息的重要部分是这样的:
I/O warning : failed to load external entity
我无法用这一行解析任何内容:
echo (string) $yahoo_response->rss->channel->item->title;
有谁知道如何解决或绕过它?
谢谢, 亚历克斯
【问题讨论】: