Load and read elements from this XML in PHP

ainsley

New Member
http://pastebin.com/hXuHpcUQIs what I have..How can I load and read the data?so for each node, I could do something like:\[code\]foreach($nodes as $node){ echo $node->getElementsByTagName("url") . "<br />";}\[/code\]But how should $nodes be defined to grab alle the \[code\]<node type="link">\[/code\]'s?This is what I have started out and currently got:\[code\] $doc = new DOMDocument(); try { $doc = new DOMDocument(); $doc->loadXml(file_get_contents('new.xml')); }catch(Exception $e) { continue; }\[/code\]I would like to output the value in \[code\]<url>\[/code\] inside each \[code\]<node></node>\[/code\] element
 
Back
Top