PHP is_int() Function

The PHP is_int() function in PHP is used to  find whether a variable is an integer or not. It returns a Boolean value true if the parameter var is integer else it returns false.

Syntax

is_integer( mixed $var ) 

Parameter

var(required)- This parameter represents the value to check.

Return

This function returns a Boolean value TRUE if the parameter var is an integer, else it returns FALSE.

Example 1

 

Output

bool(true)
bool(false) 

Example 2

 

Output

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

Example 3

 

Output

1232 is an int value.