English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
floatval The function is used to get the floating-point value of a variable.
floatval cannot be used for arrays or objects.
Version requirement: PHP 4 >= 4.2.0, PHP 5, PHP 7.
doubleval is an alias of floatval.
float floatval ( mixed $var )
Parameter description:
$var: The variable to be converted, cannot be an array or object.
The float value of the variable var.
<?php $var = '122.34343w3codebox'; $float_value_of_var = floatval($var); echo $float_value_of_var; ?>
The execution result is shown as follows:
122.34343