Open In App

PHP is_integer() Function

Last Updated : 22 Jul, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

The is_integer() function is an inbuilt function in PHP that is used to check whether the type of a variable is an integer or not. This function is an alias of is_int() function.

Syntax:

bool is_integer(mixed $value)

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

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

Example 1:

Output:

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

Example 2:

Output:

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

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


Next Article

Similar Reads