parsing - PHP: unformat money -


is there way float value of string this: 75,25 €, other parsefloat(str_replace(',', '.', $var))?

i want dependent on current site language, , comma replaced dot.

you can use

example manual:

$formatter = new numberformatter('de_de', numberformatter::currency); var_dump($formatter->parsecurrency("75,25 €", $curr)); 

gives: float(75.25)

note intl extension not enabled default. please refer installation instructions.


Comments

Popular posts from this blog

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -