is_array

This function can be used to check and see if a variable holds an array (it will return true) or not (in which case it will return false).

 

Syntax:

is_array(n);

ArgumentTypeDescription
nAnyThe variable to check.

 

Returns:

Boolean

 

Example:

if (is_array(a))
{
    a = -1;
}

The above code checks a variable to see if it is an array, and if the function returns true, the array is deleted by setting the variable to -1.