Thursday, July 23, 2026
HomeLanguagesPHP is_long() Function

PHP is_long() Function

The is_long() function is an inbuilt function in PHP that is used to check whether the given value is a long integer or not.

Syntax:

bool is_long(mixed $value)

Parameters: This function accepts a single parameter $value that holds the value which needs to check for a long integer.

Return Value: This function returns true if the given value is a long integer, and false otherwise.

Example 1:

PHP




<?php
  
$arr = array(5215523545645, 10.5, 
    null, true, "30", "GFG");
  
foreach ($arr as $val) {
    var_dump(is_long($val));
}
  
?>


Output:

bool(true)
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)

Example 2:

PHP




<?php
  
$arr = array(
    25, 
    "Geeks" => 50,
    130.25, 
    "neveropen",
    true, 
    214748364734
);
  
foreach ($arr as $val) {
    var_dump(is_long($val));
}
  
?>


Output:

bool(true)
bool(true)
bool(false)
bool(false)
bool(false)
bool(true)

Reference: https://www.php.net/manual/en/function.is-long.php

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

2 COMMENTS

Most Popular

Dominic
32520 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6902 POSTS0 COMMENTS
Nicole Veronica
12017 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12115 POSTS0 COMMENTS
Shaida Kate Naidoo
7023 POSTS0 COMMENTS
Ted Musemwa
7265 POSTS0 COMMENTS
Thapelo Manthata
6980 POSTS0 COMMENTS
Umr Jansen
6971 POSTS0 COMMENTS