PHP is_array() Function

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

Syntax

is_array ( mixed $var )

Parameter

var(required)- This parameter represents the variable being evaluated.

Return

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

Example 1

 

Output

array('Reema','Rahul','Rita') is an array. 

Example 2

 

Output

1232 is not a array value. 

Example 3

 

Output

The var is an Array

Example 4

 

Output

The var is not an Array