The function is_long() checks whether the type of a variable is integer.
bool is_long ( mixed $value )
Sr.No | Parameter & Description |
---|---|
1 |
value The variable whose type is being evaluated. |
This function returns true if value is an int, false otherwise.
PHP 4 and above
Following example demonstrates return values with different types of variables −
<?php $a = 33; echo "a is "; var_dump(is_long($a)); echo "<br>"; $b = "33"; echo "b is "; var_dump(is_long($b)); echo "<br>"; $c = 33.5; echo "c is "; var_dump(is_long($c)); echo "<br>"; $d = "33.5"; echo "d is "; var_dump(is_long($d)); echo "<br>"; $e = true; echo "e is "; var_dump(is_long($e)); echo "<br>"; $f = false; echo "f is "; var_dump(is_long($f)); echo "<br>"; $g = null; echo "g is "; var_dump(is_long($g)); echo "<br>"; ?>
This will produce following result −
a is bool(true) b is bool(false) c is bool(false) d is bool(false) e is bool(false) f is bool(false) g is bool(false)