In this article, you will learn how to check if a variable type is long or not in PHP. The is_long() function in PHP checks whether a variable is of type integer or not.
This function is an alias of is_int().
what is the syntax of the IS_LONG() function in php?
is_long(variable);
Parameter | Description |
---|---|
variable | Required. Specifies the variable to check |
examples of the IS_LONG() function
Example 1. In this example, we check whether a variable is of type integer or not.
<?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>";
?>