is_array()


bool is_array ( mixed $var )

Description

is_array() checks whether the variable is an array or not

※ available F/W version : all

Parameters

Return values

Returns TRUE if $var is an array, otherwise FALSE.

Example

<?php
$val1 = array(1, 2, 3);
$val2 = 1;

$ret1 = is_array($val1);
$ret2 = is_array($val2);

if($ret1) echo "ret1 is an array\r\n";  // OUTPUT: ret1 is an array
else echo "ret1 is NOT an array\r\n";

if($ret2) echo "ret2 is an array\r\n";
else echo "ret2 is NOT an array\r\n";  // OUTPUT: ret2 is NOT an array
?>

See also

is_bool() / is_float() / is_int() / is_string()

Remarks

This function is identical to the PHP group’s is_array().