How to format a dollar amount using PHP; money format; number_format
This will format a number into a dollar amount.
function money_format($amount) {
return number_format($amount, 2, '.', ',');
}
Example:
$amount = 123456;
echo money_format($amount); // 123,456.00
1 comment
thanks my friend
Leave a Reply