I have no problem parsing many different kinds of XML feeds and have methods for each different situation. I have come across one I am not familiar with how to attack it.
The feed has element attributes which is not a big deal but some of the attributes of the element are like this where the output is based on a value.
tornado="0" funnelcloud="0" wallcloud="0" rotation="0" hail="1" wind="0" flood="0" flashflood="0" other="0"
So basically if there is a 1 it will output that data. So how do I parse that so it outputs the listed one? I am thinking I need an array maybe? If so any examples so I can get an idea?
Here is how I parse the data which works great. Lightweight and simple.
$data = "http://www.spotternetwork.org/data.php";
$xml = simplexml_load_file($data);
foreach($xml->report as $report){
$date = $report['stamp'];
$narrative = $report['narrative'];
$loc = $report['city1'];
$tz = $report['tz'];
$time = strtotime($date.' UTC');
$dateInLocal = date("D g:i a", $time);
-Thanks