is_array
is_array判断变量类型是否为数组类型。
语法:int is_array(mixed var);
返回值: 整数
函数种类: PHP 系统功能
内容说明:
若变量为数组类型则返回 true,否则返回 false。
参考:
is_double()is_float() is_int() is_integer() is_long() is_object() is_real() is_string()
实例<?php
$colors = array("red", "blue", "green");
if(is_array($colors)){
print("colors is an array");
}else{
print("Color is not an array");
}
?>