❮ PHP Variable Handling Reference
Check whether a variable is of type float or not:
<?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 »
The is_double() function checks whether a variable is of type float or not.
This function is an alias of is_float().
is_double(
variable);
Parameter | Description |
---|---|
variable | Required. Specifies the variable to check |
Return Value: | TRUE if variable is a float, FALSE otherwise |
---|---|
Return Type: | Boolean |
PHP Version: | 4.0+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!