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