Re: [PHP] Currency Exchange Database?
Andy B. wrote: You could have a look at the Euro foreign exchange reference rates rom the European Central Bank. They also provide a regularly updated XML file: http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html /* pass this func a 3 letter currency code */ function getCurrentRate($curID) { static $rates; if (is_null($rates)) { $rates = array('EUR' = 1.0); $doc = new DomDocument; $doc-load( 'http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml' ); foreach ($doc-getElementsByTagname(Cube) as $node) { $c = $node-getAttribute(currency) and $rates[$c] = 1 / $node-getAttribute(rate); } } return (isset($rates[$curID]) ? $rates[$curID] : 0.0); } Andy -Original Message- From: Tom Ray [Lists] [mailto:[EMAIL PROTECTED] Sent: Friday, June 29, 2007 02:45 To: php-general@lists.php.net Subject: [PHP] Currency Exchange Database? I have a client that's looking to do auto conversions of currency on their reservation payment form. No big deal, I can that part down. However, exchange rates change on a minute to minute basis and they want the program to automatically know the current rates. Is there an online database or a way I can tap into a database that has that information? Any help would be appreciated. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Currency Exchange Database?
On Thu, 2007-06-28 at 20:44 -0400, Tom Ray [Lists] wrote: I have a client that's looking to do auto conversions of currency on their reservation payment form. No big deal, I can that part down. However, exchange rates change on a minute to minute basis and they want the program to automatically know the current rates. Is there an online database or a way I can tap into a database that has that information? I am pretty sure, although I may be wrong, that http://xe.com provides a webservice for this. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Currency Exchange Database?
I thought about that but I'm looking to make it seem-less. I just want to get the numbers and do the conversion myself not have the third party do it. I just need an updated list on a daily/hourly basis. Paul Scott wrote: On Thu, 2007-06-28 at 20:44 -0400, Tom Ray [Lists] wrote: I have a client that's looking to do auto conversions of currency on their reservation payment form. No big deal, I can that part down. However, exchange rates change on a minute to minute basis and they want the program to automatically know the current rates. Is there an online database or a way I can tap into a database that has that information? I am pretty sure, although I may be wrong, that http://xe.com provides a webservice for this. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Currency Exchange Database?
You could have a look at the Euro foreign exchange reference rates rom the European Central Bank. They also provide a regularly updated XML file: http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html Hope it helps... Andy -Original Message- From: Tom Ray [Lists] [mailto:[EMAIL PROTECTED] Sent: Friday, June 29, 2007 02:45 To: php-general@lists.php.net Subject: [PHP] Currency Exchange Database? I have a client that's looking to do auto conversions of currency on their reservation payment form. No big deal, I can that part down. However, exchange rates change on a minute to minute basis and they want the program to automatically know the current rates. Is there an online database or a way I can tap into a database that has that information? Any help would be appreciated. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php