Current Article:

How to get number of decimal digits in PHP?

How to get number of decimal digits in PHP?

Combination of the strpos and strrev functions will do the trick:

$str = "1.1234567";
echo (int) strpos(strrev($str), ".");