How can I return the '3' in:
<element type="forecast_icon_code">3</element>
from this external xml:
ftp://ftp2.bom.gov.au/anon/gen/fwo/IDV10450.xml
Here is my function:
function state($Sitelink) {
$url = $Sitelink;
$file = $url;
if(!$xml = simplexml_load_file($file))
exit('Failed to open '.$file);
$result = $xml->forecast->forcast-period->element;
print_r($result);
}
Calling the function using:
state("ftp://ftp2.bom.gov.au/anon/gen/fwo/IDV10450.xml")