Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP money_format for EURO

We can use following code for get $ mark and format money.

setlocale(LC_MONETARY, 'en_US.UTF-8');
$amount = money_format('%(#1n', $amount);

How to get euro symbol from php money_format?

like image 658
Dinuka Thilanga Avatar asked May 13 '13 10:05

Dinuka Thilanga


2 Answers

$price = 880000;
echo number_format($price, 2, ',', '.');

input => 880000

output => 880.000,00

like image 70
Mahdi Bashirpour Avatar answered Oct 13 '22 00:10

Mahdi Bashirpour


i think this will work

setlocale(LC_MONETARY, 'nl_NL.UTF-8');
$amount = money_format('%(#1n', 20);
echo $amount;

Warning :-

This function has been DEPRECATED as of PHP 7.4.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged.

like image 32
Rajeev Ranjan Avatar answered Oct 12 '22 23:10

Rajeev Ranjan