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

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -