PHP is_long() 函数
实例
检查变量是否为整数类型:
<?php
$a = 32;
echo "a is " . is_long($a) . "<br>";
$b = 0;
echo "b is " . is_long($b) . "<br>";
$c = 32.5;
echo "c is " . is_long($c) . "<br>";
$d = "32";
echo "d is " . is_long($d) . "<br>";
$e = true;
echo "e is " . is_long($e) . "<br>";
$f = "null";
echo "f is " . is_long($f) . "<br>";
?>
亲自试一试 »
$a = 32;
echo "a is " . is_long($a) . "<br>";
$b = 0;
echo "b is " . is_long($b) . "<br>";
$c = 32.5;
echo "c is " . is_long($c) . "<br>";
$d = "32";
echo "d is " . is_long($d) . "<br>";
$e = true;
echo "e is " . is_long($e) . "<br>";
$f = "null";
echo "f is " . is_long($f) . "<br>";
?>
定义和用法
is_long() 函数检查变量是否为整数类型。
这个函数是is_int()的别名。
语法
is_long(variable);
参数值
参数 | 描述 |
---|---|
variable | 必需。指定要检查的变量 |
技术细节
返回值: | 如果 变量 是整数,则为 TRUE,否则为 FALSE |
---|---|
返回类型: | Boolean |
PHP 版本: | 4.0+ |