is_double
is_float alias
is_double()
function checks whether the variable is of type float.
This function is an alias for is_float()
.
Tip: In PHP, floats and doubles are considered to be of the same type. Therefore, the is_double()
function is actually just an alias for is_float()
function. In actual use, it is more recommended to use the is_float()
function because its name describes its function more accurately.
Check whether the variable is float type:
<?php $a = 32 ; echo "a is " . is_double ( $a ) . "<br>" ; $b = 0 ; echo "b is " . is_double ( $b ) . "<br>" ; $c = 32.5 ; echo "c is " . is_double ( $c ) . "<br>" ; $d = "32" ; echo "d is " . is_double ( $d ) . "<br>" ; $e = true ; echo "e is " . is_double ( $e ) . "<br>" ; $f = "null" ; echo "f is " . is_double ( $f ) . "<br>" ; $g = 1.e3 ; echo "g is " . is_double ( $g ) . "<br>" ; ?>
Try it yourself
is_double ( variable ) ;
parameter | describe |
---|---|
variable | Required. Specifies the variable to check. |