Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP floatval(), doubleval() functions

PHP floatval(), doubleval() functions

PHP Available FunctionsAvailable PHP 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:

Return Value

The float value of the variable var.

Example

Example

The execution result is as follows:


122.34343

PHP Available FunctionsAvailable PHP Functions