Easy Tutorial
❮ Func Filesystem Mkdir Func String Strcspn ❯

PHP floatval(), doubleval() Functions

Available PHP Functions

The floatval function is used to get the float value of a variable.

floatval cannot be used on arrays or objects.

Version requirements: 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

<?php
$var = '122.34343tutorialpro';
$float_value_of_var = floatval($var);
echo $float_value_of_var;
?>

The execution result is as follows:

122.34343

Available PHP Functions

❮ Func Filesystem Mkdir Func String Strcspn ❯