以编程方式访问货币汇率 [英] Programmatically access currency exchange rates

查看:105
本文介绍了以编程方式访问货币汇率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立一个在线订购系统,但我在澳大利亚,对于国际客户,我想以美元或欧元显示价格,这样他们就不必花心思从澳元转换

I'm setting up an online ordering system but I'm in Australia and for international customers I'd like to show prices in US dollars or Euros so they don't have to make the mental effort to convert from Australian dollars.

有人知道我能否以一种易于解析的格式从网上某处提取最新汇率,我可以从我的PHP脚本中访问该汇率吗?

Does anyone know if I can pull up to date exchange rates off the net somewhere in an easy-to-parse format I can access from my PHP script ?

更新:我现在编写了一个实现该功能的PHP类. 您可以从我的网站获取代码.

UPDATE: I have now written a PHP class which implements this. You can get the code from my website.

推荐答案

您可以从yahoo获取简单格式的货币换算:

You can get currency conversions in a simple format from yahoo:

例如,要将GBP转换为EUR,请执行以下操作: http://download.finance.yahoo.com/d/quotes.csv?s=GBPEUR=X&f=sl1d1t1ba&e=.csv

For example, to convert from GBP to EUR: http://download.finance.yahoo.com/d/quotes.csv?s=GBPEUR=X&f=sl1d1t1ba&e=.csv

这篇关于以编程方式访问货币汇率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆