XML : PHP - Get value from xml file

Using the following xml: http://www.bnr.ro/nbrfxrates.xml

How can I get the EUR value?

Been trying like this ... but no luck.

              $xmlDoc = new DOMDocument();              $xmlDoc->load('http://www.bnr.ro/nbrfxrates.xml');                $searchNode = $xmlDoc->getElementsByTagName("Cube");                var_dump($searchNode);                foreach ($searchNode as $searchNode) {                  $valueID = $searchNode->getAttribute('Rate');                    echo $valueID;                }    

No comments:

Post a Comment