xotelia/fixerio-php-client

FixerIO PHP 客户端

1.0.0 2016-03-02 17:55 UTC

This package is not auto-updated.

Last update: 2019-10-24 19:19:35 UTC


README

Fixer.io API 的简单 PHP 客户端

安装

$ composer require xotelia/fixerio-php-client

使用方法

<?php

require __DIR__.'/vendor/autoload.php';

use FixerIO\FixerIO;

$fixer = new FixerIO();
$rates = $fixer->fetchRates('EUR', ['GBP', 'USD']);

使用缓存

$cache = new \Doctrine\Common\Cache\FilesystemCache('./cache');

$fixer = new FixerIO($cache, 3600);
$rates = $fixer->fetchRates('EUR', ['GBP', 'USD']);