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