PHP doubleval() Function

PHP empty() Function
PHP debug_zval_dump() Function

In this article, you will learn how to get the floating value of a variable in PHP. The doubleval() function in PHP returns the float value of a variable. This function is an alias of floatval().

what is the syntax of the DOUBLEVAL() function in php?

doubleval(variable);
ParameterDescription
variableRequired. Specifies the variable to check. Must be a scalar type
PHP DOUBLEVAL() method

examples of the DOUBLEVAL() function

Example 1. In this example, we get the float value of different variables.

<?php
$a = "1234.56789";
echo doubleval($a) . "<br>";

$b = "1234.56789Hello";
echo doubleval($b) . "<br>";

$c = "Hello1234.56789";
echo doubleval($c) . "<br>";
?>
PHP empty() Function
PHP debug_zval_dump() Function
en English
X
Scroll to Top