$quantity = filter_input(INPUT_GET, 'quantity', FILTER_SANITIZE_NUMBER_FLOAT);
Input: 100.25
100.25
Output: 10025
10025
How can I preserve the . character?
.
Try this...
$quantity = filter_input( INPUT_GET, 'quantity', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
CodePad.
2.1m questions
2.1m answers
60 comments
57.0k users