I did this
<blink>
$xml = file_get_contents(http://weather.yahooapis.com/forecastrss?w=12797541);
$yahoo_response = new SimpleXMLElement($xml , 0, true);
</blink>
And I got an XML parse warning like this:
PHP Warning: SimpleXMLElement::__construct()
[<a href='simplexmlelement.--construct'>simplexmlelement.--construct</a>]:
I/O warning : failed to load external entity "<?xml version="1.0"
…..
With an important part of the message being this:
I/O warning : failed to load external entity
And I could not parse anything with this line:
echo (string) $yahoo_response->rss->channel->item->title;
Does anyone know how to fix this or get around it?
Thanks,
Alex
3rd argument of
SimpleXMLElement()specifies if$datais URL. You should do eitheror