Location: PHPKode > scripts > XML Currency Reader > xml-currency-reader/index.php
<?php

require_once('XML_currency_reader.class.php');
require_once('BNR_reader.class.php');

// create an object
$bnrob = new BNR_reader();

// parse the content
$content = $bnrob->parse_xml();

// display the rate for USD
echo 'First method: raw array display <br />';
echo 'Exchange Rate for 1 USD is : ' .$content[2][18]['rate'] .'<br /><br />';

// or use the class method
$ret_arr = $bnrob->parse_rate_contents($content[2], 'USD');
echo 'Second method: parse_rate_contents() <br />';
echo 'Exchange Rate for 1 USD is : ' .$ret_arr['rate'] .'<br />';

// debug
echo '<pre>' .print_r($content, true).'</pre>';



?>
Return current item: XML Currency Reader