use Money\Currency; use Money\Money; $amount = 1000; // $10.00 $currency = new Currency('USD'); $money = new Money($amount, $currency);
INSERT INTO mytable (value, currency) VALUES (1000, 'USD');Alternatively, you could use an ORM or other database abstraction layer to save the value in a more abstract way. Overall, the MoneyPHP library provides a simple and consistent API for working with currency values, making it a good choice for currency saving in PHP applications.