1. Go to this page and download the library: Download philiprehberger/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/ */
philiprehberger / php-money example snippets
use PhilipRehberger\Money\Money;
// Static currency factories — amount in smallest unit (cents)
$price = Money::USD(1999); // $19.99
$tax = Money::EUR(1500); // €15.00
$pence = Money::GBP(999); // £9.99
// Generic factory
$amount = Money::of(500, 'CAD'); // CA$5.00
// Zero value
$nothing = Money::zero('USD');
// Parse a formatted string
$parsed = Money::parse('$29.99', 'USD'); // Money::USD(2999)
$parsed2 = Money::parse('€1,299.00', 'EUR'); // Money::EUR(129900)