tomwright/currency-php-fixerio-rate-fetcher

该软件包最新版本(dev-master)没有提供许可信息。

FixerIO API获取汇率扩展。

dev-master 2017-10-23 14:59 UTC

This package is auto-updated.

Last update: 2021-01-09 08:27:07 UTC


README

Build Status Latest Stable Version Total Downloads Monthly Downloads Daily Downloads License

安装

安装CurrencyPHP

composer require tomwright/currency-php
composer require tomwright/currency-php-fixerio-rate-fetcher

用法

FixerIORateFetcher仅仅是CurrencyPHP的RateFetcher。

$rateFetcher = new FixerIORateFetcher();

$gbp = new Currency('GBP', $rateFetcher);
$usd = new Currency('USD', $rateFetcher);

$priceInGBP = 100;
$priceInUSD = $gbp->convertTo($usd, $priceInGBP);
echo $priceInUSD; // 126