sw-ffm/ecb-exchange-rates
最新稳定版本:v1.0.1
Composer 安装命令:
composer require sw-ffm/ecb-exchange-rates
包简介
PHP class for the implementation, fetching and Json parsing of the daily exchange rates published by the ECB. The reference rates are usually updated once at around 16:00 CET every working day, except on target closing days.
README 文档
README
PHP class for the implementation, fetching and Json parsing of the daily exchange rates to EUR published by the ECB. The reference rates are usually updated once at around 16:00 CET every working day, except on target closing days. For further information see: https://www.ecb.europa.eu/stats/eurofxref and https://www.iso.org/iso-4217-currency-codes.html
Composer
composer require sw-ffm/ecb-exchange-rates
Usage
<?php
use EcbExchangeRates\EcbExchangeRates;
require './vendor/autoload.php';
$ezb_rates = new EcbExchangeRates;
// Json-Data
echo $ezb_rates->exchange_rates_json . PHP_EOL;
// Array-Data
var_dump($ezb_rates->exchange_rates_array);
// Cache Data
/* $caching_file = __DIR__ . '/cache/DailyExchangeRates.json';
if($caching_file){
if($ezb_rates->cacheData($caching_file)){
echo "File saved";
}
} */
Data structure
{
"USD": "1.0828",
"JPY": "162.76",
"BGN": "1.9558",
"CZK": "25.457",
"DKK": "7.4621",
"GBP": "0.84380",
"HUF": "395.78",
"PLN": "4.2908",
"RON": "4.9749",
"SEK": "11.6125",
"CHF": "0.9533",
"ISK": "149.90",
"NOK": "11.8175",
"TRY": "35.9085",
"AUD": "1.6635",
"BRL": "6.0874",
"CAD": "1.4977",
"CNY": "7.8194",
"HKD": "8.4589",
"IDR": "17634.43",
"ILS": "4.0822",
"INR": "90.6250",
"KRW": "1485.96",
"MXN": "20.3317",
"MYR": "4.9749",
"NZD": "1.8289",
"PHP": "63.218",
"SGD": "1.4491",
"THB": "38.629",
"ZAR": "19.7400",
"EUR": "1",
"data_timestamp": "2024-07-31",
"system_timestamp": "2024-07-31"
}
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2024-07-31