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