Skip to content

is_array ​

php
bool is_array ( mixed $zmienna )

Checks whether $zmienna is an array. Returns true if it is an array, or false otherwise.

Example:

php
$test = array(1, 2, 3);

if ($test == true) {
print('The variable is an array');
} elseif($test == false) {
print('The variable is not an array');
}

Result:

The variable is an array