i have a client that wants to fill some space on their web page with the conversions of one USD to a couple of other currencies, and wants the rates to be updated frequently. is there some site that offers this type of widget i can just throw on the page?
customise and use this code so that no other brands will appear in your site. <?php function Google_Currency($amount, $from, $to) { $matches = array(); if (preg_match('~<b>.+? = (.+?)</b></h2>~', file_get_contents('http://www.google.com/search?q=' . urlencode(floatval($amount) . ' ' . strtoupper($from) . ' to ' . strtoupper($to))), $matches) > 0) { if (array_key_exists(1, $matches) === true) { return floatval($matches[1]); } } return false; } echo Google_Currency(1, 'USD', 'FJD'); // 0.768816791 echo Google_Currency(1, 'USD', 'GBP'); // 0.686671702 echo Google_Currency(1, 'EUR', 'USD'); // 1.3007 echo Google_Currency(1, 'EUR', 'GBP'); // 0.893153883 echo Google_Currency(1, 'GBP', 'USD'); // 1.4563 echo Google_Currency(1, 'GBP', 'EUR'); // 1.11962789 ?>