is_real
is_float 的别名
is_real()
函数检查变量是否为 float 类型。
该函数是 is_float()
的别名。
检查变量是否为 float 类型:
<?php $a = 32; echo "a is " . is_real($a) . "<br>"; $b = 0; echo "b is " . is_real($b) . "<br>"; $c = 32.5; echo "c is " . is_real($c) . "<br>"; $d = "32"; echo "d is " . is_real($d) . "<br>"; $e = true; echo "e is " . is_real($e) . "<br>"; $f = "null"; echo "f is " . is_real($f) . "<br>"; $g = 1.e3; echo "g is " . is_real($g) . "<br>"; ?>
亲自试一试
is_real(variable);
参数 | 描述 |
---|---|
variable | 必需。指定要检查的变量。 |