php help: convert a , into a .
how can I convert an input: $num1 = $_POST['num1'];
Say someone enters 1,5 and I want this to convert to 1.5
How can I do this?
Thanks for your time
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
How to Ask Questions the Smart Way
(not affiliated with this site, but well worth reading)
$conv = str_replace(",", ".", $num1);
echo($conv); // to test it out
works perfectly, thanks a million
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)