tawba / currency-converter
货币转换器
v1.7
2017-01-20 13:37 UTC
Requires
- php: >=5.6.4
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: 4.4.*
This package is not auto-updated.
Last update: 2024-09-29 03:36:24 UTC
README
货币转换器包帮助您轻松将特定货币的任何金额转换为另一种货币。
安装
使用 Composer
composer install
或者您也可以这样做
composer require tawba/currency-converter
如果您没有 composer,您可以从 Composer 获取
运行应用程序
php index.php list
php index.php convert
用法
use Tawba\CurrencyConverter\ConverterService;
$from_currency = "USD";
$to_currency = "EGP";
$amount = 1000;
$converter = new ConverterService(); // You can pass "google" or "yahoo" as a service API
echo $converter->convert($from_currency, $to_currency, $amount);
您可以通过更改 index.php 文件中存在的 $from_currency、$to_currency 和 $amount 来测试它
注意:此包使用 Google 或 Yahoo 货币转换器 API。