Parsing a string value to a float value is not consistent in my PHP project. Altough I'm not changing my code and the values to parse are always the same I sometimes get a result with a comma and sometimes with a point.
The incoming value is for example: 35,59 Before parsing this value I first replace the comma by a point.
$value = '35,59';
$value = (float)str_replace(',', '.', $value);
var_dump($value);
When I now use this value in my insert query, this sometimes results in a bug because a comma is used. This is all a bit weird to me, has anyone experienced this before? How can I prevent this from happening?
Edit: I indeed forgot my quotes in this example, but I did use quotes in my code