reading external XML file [closed]

Mansonikddyx

New Member
I need to use an external XML file, I've tried different methods to read the file but can't reach what I want.I used \[code\]DOMDocument\[/code\] \[code\]simplexml_load_file\[/code\]\[code\]<?$xml = simplexml_load_file("http://www.isecur1ty.org/InternetThreat/ThreatLevel.xml");echo $xml->getName() . "<br />";foreach($xml->children() as $child){ echo $child->getName() . ": " . $child . "<br />";}?>\[/code\]But can't get it working with me!!Here is the XML file:\[code\]<iS-InternetThreat> <level> <current>2</current> <previous>2</previous> <status>same</status> <date>09-06-2012</date> </level> <version>2.5</version></iS-InternetThreat>\[/code\]As you can see, there are multi-levels. I need to get the values of each attribute (mainly under "level"), getting the version would be also ok.Can somebody tell me how to do this?Thanks.
 
Back
Top