PHPackages                             jdrda/cnb-currency-converter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jdrda/cnb-currency-converter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jdrda/cnb-currency-converter
============================

PHP currency converter using official Czech National Bank daily exchange rates and Symfony Cache.

0.1.1(2mo ago)020MITPHPPHP &gt;=7.1.3

Since May 7Pushed 2mo agoCompare

[ Source](https://github.com/jdrda/cnb-currency-converter)[ Packagist](https://packagist.org/packages/jdrda/cnb-currency-converter)[ Docs](https://github.com/jdrda/cnb-currency-converter)[ RSS](/packages/jdrda-cnb-currency-converter/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

CNB Currency Converter 💱🇨🇿
==========================

[](#cnb-currency-converter-)

[![License: MIT](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)[![PHP](https://camo.githubusercontent.com/591132b252b5ceac6eef013e412006a6fe74bbad7558950e4831c747a29c0867/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344253230372e312e332d3737376262342e737667)](composer.json)[![Symfony Cache](https://camo.githubusercontent.com/d0af7ae960c40e97b4cae491978c7dcd647939eb92f9cf1d0549bcbf5177bc51/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63616368652d53796d666f6e7925323043616368652d626c61636b2e737667)](https://symfony.com/doc/current/components/cache.html)[![PSR-6](https://camo.githubusercontent.com/e172fe288b43e116eaa8c192f0bd8fb2b4938f1d00f4954c117cd15724b8fb36/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f63616368652d5053522d2d362d626c75652e737667)](https://www.php-fig.org/psr/psr-6/)[![Composer](https://camo.githubusercontent.com/7c79e94c14ccce3c1bcf83e2aefab3bc7c2a7cc6049061602c3ce5f67e88530d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f696e7374616c6c2d636f6d706f7365722d626c75652e737667)](https://getcomposer.org/)[![Packagist](https://camo.githubusercontent.com/fde32f67ab00cc8836ea5924ffab8f60c88907b1858cf91e29bb7cec5119d5d0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7061636b61676973742d6a64726461253246636e622d2d63757272656e63792d2d636f6e7665727465722d6f72616e67652e737667)](composer.json)[![CNB](https://camo.githubusercontent.com/ed4de93bfd460745220976aace71700c12eafc5983c813e5776f18ce062f49c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646174612d437a6563682532304e6174696f6e616c25323042616e6b2d7265642e737667)](https://www.cnb.cz/)[![CZK](https://camo.githubusercontent.com/10d0021d676b0eb8a5eeddbcec2cbb8b695b00c0eadb526a4c15c5f786f28b6a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f626173652d435a4b2d737563636573732e737667)](#converting-through-czk)[![Status](https://camo.githubusercontent.com/99d3304b043e56dad6750ee4b2fd5f9a47325ed7187e07cd168aa77ef4f0db79/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374617475732d7075626c69736865642d737563636573732e737667)](#installation)[![Packagist Version](https://camo.githubusercontent.com/7f2c093f0d6b0f3353a3b1a80e18b3b14e5575fa1855d9b3e725bbce1e598b9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a647264612f636e622d63757272656e63792d636f6e7665727465722e737667)](https://packagist.org/packages/jdrda/cnb-currency-converter)[![Packagist Downloads](https://camo.githubusercontent.com/fd317c24d8287145a242bba0b94bd6416ac3cb16d99677916ba9b08501e64f1c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a647264612f636e622d63757272656e63792d636f6e7665727465722e737667)](https://packagist.org/packages/jdrda/cnb-currency-converter)

A small PHP **currency converter** using the official daily exchange-rate table published by the Czech National Bank (CNB).

It can:

- ✅ show the official CZK quote for a given currency,
- ✅ normalize CNB rates quoted for 1, 100 or 1000 units,
- ✅ convert any supported currency to any other supported currency through CZK,
- ✅ load the latest available CNB exchange-rate table,
- ✅ load a historical CNB table by date,
- ✅ cache downloaded tables for one day,
- ✅ use Symfony Cache out of the box,
- ✅ accept any PSR-6 cache pool,
- ✅ work in older PHP 7.1.3 systems and modern PHP 8.x projects.

Installation
------------

[](#installation)

```
composer require jdrda/cnb-currency-converter
```

Requirements
------------

[](#requirements)

```
PHP >= 7.1.3
symfony/cache ^4.4 || ^5.4 || ^6.4 || ^7.0
psr/cache ^1.0 || ^2.0 || ^3.0

```

The package allows multiple Symfony Cache major versions, so Composer can choose a version that fits the PHP runtime:

- old PHP 7.1 projects can use Symfony Cache 4.4,
- newer PHP 7.2+ projects can use Symfony Cache 5.4,
- PHP 8.1+ projects can use Symfony Cache 6.4,
- modern PHP 8.2+ / 8.3+ / 8.4 projects can use Symfony Cache 7.x.

Basic usage
-----------

[](#basic-usage)

```
