Welcome Guest, Not a member yet? Register   Sign In
handling form values
#1

[eluser]crwtrue[/eluser]
Is this a good solution?

I have a form that has an input field where user can submit a decimal value like 12.12 and this value is then inserted to mysql table. The problem is if user use comma in his value like 12,12. So i was thinking of doing a if-else check with regular expression to change value that has comma to dot.
#2

[eluser]sico87[/eluser]
could you not just do str_replace() something like,

Code:
str_replace(",",".",$fDecimalValue);
#3

[eluser]crwtrue[/eluser]
thx for reply. yeah thats seems even better solution.




Theme © iAndrew 2016 - Forum software by © MyBB