$quantity = filter_input(INPUT_GET, 'quantity', FILTER_SANITIZE_NUMBER_FLOAT);
Input: 100.25
Output: 10025
How can I preserve the .
character?
Try this...
$quantity = filter_input( INPUT_GET, 'quantity', FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
CodePad.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With