load(\'http://weather.yahooapis.com/forecastrss?p=VEXX0024&u=c\');
$channel = $doc->getElementsByTagNa
Something like:
echo $itemgotten->getElementsByTagNameNS(
"http://xml.weather.yahoo.com/ns/rss/1.0","condition")->item(0)->
getAttribute("temp");
The key is that you have to use getElementsByTagNameNS
instead of getElementsByTagName
and specify "http://xml.weather.yahoo.com/ns/rss/1.0"
as the namespace.
You know yweather
is a shortcut for http://xml.weather.yahoo.com/ns/rss/1.0
because the XML file includes a xmls
attribute: