XML Help
Posted: Sun Feb 20, 2011 10:10 am
Hello Everyone,
I am trying to Use SimpleXML to Work, a Very simple Echo of a Root. I cannot for the life of me figure this out. Any Help would be appreciated. Nothing will print.
I am trying to Use SimpleXML to Work, a Very simple Echo of a Root. I cannot for the life of me figure this out. Any Help would be appreciated. Nothing will print.
Code: Select all
<?php
$file = "http://weather.aero/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&stationString=KDEN&hoursBeforeNow=1";
// load file
$xml = simplexml_load_file($file) or die ("Unable to load XML file!");
// access XML data
echo 'Metar: '.$xml->metar->raw_text.'<br />';
?>