Error/Warning parsing RSS XML :( -


i did

<blink> $xml = file_get_contents(http://weather.yahooapis.com/forecastrss?w=12797541); $yahoo_response = new simplexmlelement($xml , 0, true); </blink> 

and got xml parse warning this:

php warning:  simplexmlelement::__construct() [<a href='simplexmlelement.--construct'>simplexmlelement.--construct</a>]: i/o warning : failed load external entity &quot;&lt;?xml version=&quot;1.0&quot;  

.....

with important part of message being this:

i/o warning : failed load external entity  

and not parse line:

echo (string) $yahoo_response->rss->channel->item->title; 

does know how fix or around it?

thanks, alex

3rd argument of simplexmlelement() specifies if $data url. should either

$xml = file_get_contents('http://weather.yahooapis.com/forecastrss?w=12797541'); $yahoo_response = new simplexmlelement($xml , 0, false); // false, not true 

or

$xml = 'http://weather.yahooapis.com/forecastrss?w=12797541'; // url, not contents $yahoo_response = new simplexmlelement($xml , 0, true); 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -