1. Go to this page and download the library: Download ez-php/money library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ez-php / money example snippets
use EzPhp\Money\Money;
$price = Money::of('19.99', 'EUR'); // from decimal string
$tax = Money::ofMinorUnits(199, 'EUR'); // from cents → 1.99 EUR
$zero = Money::zero('USD');
// JPY has no minor units (scale = 0)
$yen = Money::of('1000', 'JPY');
use EzPhp\Money\Formatter\DecimalMoneyFormatter;
use EzPhp\Money\Formatter\IntlMoneyFormatter;
$plain = new DecimalMoneyFormatter();
$plain->format($price); // "19.99"
$withCode = new DecimalMoneyFormatter(includeCurrencyCode: true);
$withCode->format($price); // "19.99 EUR"
$intl = new IntlMoneyFormatter('de_DE'); //
use EzPhp\Money\Parser\DecimalMoneyParser;
use EzPhp\Money\Parser\IntlMoneyParser;
$parser = new DecimalMoneyParser();
$money = $parser->parse('19.99', 'EUR');
$intlParser = new IntlMoneyParser('en_US'); //