I have a form in which people will be entering dollar values.
The user can enter a dollar value however they wish. I want to read the inputs as doubles so I can total them.
I tried just typecasting the strings to doubles but that didn't work. Total just equals 50 when it is output:
$string1 = "$50,000"; $string2 = "$50000"; $string3 = "50,000"; $total = (double)$string1 + (double)$string2 + (double)$string3; echo $total;