rapidwebltd/simple-currency-rates
Composer 安装命令:
composer require rapidwebltd/simple-currency-rates
包简介
This package provides simple access to current currency exchange rates.
README 文档
README
This package provides simple access to current currency exchange rates.
Installation
Simple Currency Rates can be easily installed using Composer. Just run the following command from the root of your project.
composer require rapidwebltd/simple-currency-rates
If you have never used the Composer dependency manager before, head to the Composer website for more information on how to get started.
Usage
To get the current exchange rates, just create a new SimpleCurrencyRates object and call its get method with the base currency of your choice (e.g. GBP, USD, EUR). The following code snippet shows how to do this.
$rates = (new SimpleCurrencyRates)->get('GBP');
Exchange rates are returned as an array in the format ['CURRENCYCODE' => RATE, ...]. An example rates array is shown below.
Array ( [AUD] => 1.7307 [BGN] => 2.201 [BRL] => 4.423 [CAD] => 1.7099 [CHF] => 1.3274 [CNY] => 8.8656 [CZK] => 28.715 [DKK] => 8.3831 [EUR] => 1.1254 [GBP] => 1 [HKD] => 10.767 [HRK] => 8.3542 [HUF] => 347.46 [IDR] => 18357 [ILS] => 4.7002 [INR] => 88.15 [JPY] => 152.37 [KRW] => 1465.7 [MXN] => 25.837 [MYR] => 5.457 [NOK] => 10.838 [NZD] => 1.8915 [PHP] => 69.704 [PLN] => 4.6942 [RON] => 5.231 [RUB] => 77.678 [SEK] => 11.054 [SGD] => 1.8214 [THB] => 44.015 [TRY] => 5.2259 [USD] => 1.3763 [XBT] => 0.00013526 [ZAR] => 16.877 )
统计信息
- 总下载量: 30
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-only
- 更新时间: 2018-01-05