PHP Tutorial - PHP is_array(value) function






is_array(value) returns true if value is an array.

Syntax

PHP is_array(value) function has the following syntax.

is_array(value)

Parameter

  • value is the variable being type checked.

Return

is_array(value) returns true if value is an array.





Example

Is it an array?


<?php
$values = array(2, "2", 2.5, "2.5", null, true);

var_dump(is_array($values));


?>

The code above generates the following result.