convert string to decimal in php code example Example 1: string to double php $floatValue = floatval("1.0"); Example 2: php float value floatval ($var)