0

I am looking to convert a decimal string, so it outputs without the decimal.

The following works correctly, outputting '13495' as an INT.

$current_total = intval(str_replace(".","","134.95"));

Is there any reason why this method shouldn't be used?

ccdavies
  • 1,576
  • 5
  • 19
  • 29

0 Answers0