convert integer to decimal in php code example Example: string to decimal php $num = (double) "10.12";