how to convert a string to a number with decimal in php code example Example: string to decimal php $num = (double) "10.12";