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