<?php
// CurrencyExchange class usage example require_once('class_CurrencyExchange.php'); $exchange = new CurrencyExchange(); if ($exchange->retrieve()) {
// Display the current Canadian exchange rate information var_dump($exchange->rates["CAD"]);
// Display all exchange rates returned by the CurrencyExchange class foreach ($exchange->rates as $currency=>$rate) { echo "Currency: $currency<br>". "Exchange rate: ". $rate["rate"]."<br>". "Country: ". $rate["unit"]."<br>". "Units: ". $rate["unit"]."<br>". "Date retrieved: ". $rate["date"]."<br><br>"; }
// Display information about the source of the exchange rate information // (eg: if it was retrieved from the Federal Reserve Bank of NY, the // Bank of Canada, etc.) var_dump($exchange->source); } // ------------------------------------------------------------------------
?>
|