| // +----------------------------------------------------------------------+ // // $Id: example.php,v 1.3 2005/06/23 08:10:19 cross Exp $ /** * Example using Services_ExchangeRates to create a form-based currency converter * * @package Services_ExchangeRates */ /** * Requires Services_ExchangeRates to function */ require_once 'Services/ExchangeRates.php'; /** * Creates new instance of currency converter * * @param string Choose where the exchange rates are coming from. In this case, * it's the European Central Bank. * @param string Choose where the currency rates are coming from. In this case, * it's the United Nations. */ $conv = new Services_ExchangeRates('ECB', 'UN'); ?> Currency Converter - PEAR::Services_ExchangeRates Example

Currency Converter

"; echo $conv->format($_POST['amount']) . ' ' . $_POST['from']; echo " = "; echo $conv->convert($_POST['from'], $_POST['to'], $_POST['amount']) . ' ' . $_POST['to']; echo ""; } else { echo "

Enter how much you want to convert!

"; } $options = array(); foreach ($conv->validCurrencies as $code => $label) { $options .= ''; } ?>

I want to convert...