PHP floatval(), doubleval() functions
floatval The function is used to get the float value of a variable.
floatval cannot be used on arrays or objects.
Version requirement: PHP 4 >= 4.2.0, PHP 5, PHP 7.
doubleval is an alias of floatval.
Syntax
float floatval ( mixed $var )
Parameter Description:
- $var: the variable to be converted, must not be an array or object.
Return Value
The float value of the variable var.
Example
Example
The execution result is as follows:
122.34343
Available PHP Functions