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

4 COMMENTS

Most Popular

Dominic
32700 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
7076 POSTS0 COMMENTS
Nicole Veronica
12208 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12300 POSTS0 COMMENTS
Shaida Kate Naidoo
7196 POSTS0 COMMENTS
Ted Musemwa
7456 POSTS0 COMMENTS
Thapelo Manthata
7170 POSTS0 COMMENTS
Umr Jansen
7158 POSTS0 COMMENTS