ujjwal/currency-converter
最新稳定版本:2.6
Composer 安装命令:
composer require ujjwal/currency-converter
包简介
Currency Converter Class with features of caching and identifying currency from country Code
README 文档
README
Exchange rates/Currency Converter Library with features of caching and identifying currency from country code.
Getting started
<?php require 'vendor/autoload.php'; $converter = new CurrencyConverter\CurrencyConverter; echo $converter->convert('USD', 'NPR'); // will print something like 97.44 // caching currency $cacheAdapter = new CurrencyConverter\Cache\Adapter\FileSystem(__DIR__ . '/cache/'); $cacheAdapter->setCacheTimeout(DateInterval::createFromDateString('10 second')); $converter->setCacheAdapter($cacheAdapter); echo $converter->convert('USD', 'NPR');
Why Use It
- Reliable Rate, Uses fixer.io API
- Caching of rate, to avoid connecting to fixer.io again and again
- Conversion without currency code(from country code)
Requirements
- PHP version 5.5 or later
- Curl Extension (Optional)
Installation
This library depends on composer for installation . For installation of composer, please visit getcomposer.org.
Add "ujjwal/currency-converter":"2.*" to your composer.json and run php composer.phar update
Usage
Please head on to /examples folder.
For further documentation, please look at the /docs.
统计信息
- 总下载量: 220.02k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 49
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-02-02