php convert string to decimal code example Example 1: string to decimal php Click to copy$num = (double) "10.12"; Example 2: php float value Click to copyfloatval ($var)