PHP is_array() 函数

PHP 教程 · 2019-01-31 16:43:33

is_array() 函数用于检测变量是否是一个数组。

PHP 版本要求:PHP 4, PHP 5, PHP 7

语法

bool is_array ( mixed $var )

参数说明:

  • $var:要检测的变量。

返回值

如果检测的变量是数组,则返回 TRUE,否则返回 FALSE。

实例

实例

<?php $arr_site = array('Google', 'Codercto', 'Facebook'); if(is_array($arr_site)){ echo '变量 $arr_site 是一个数组'; } else { echo '变量 $arr_site 不是一个数组'; } ?>

输出结果为:

变量 $arr_site 是一个数组

点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Don't Make Me Think

Don't Make Me Think

Steve Krug / New Riders Press / 18 August, 2005 / $35.00

Five years and more than 100,000 copies after it was first published, it's hard to imagine anyone working in Web design who hasn't read Steve Krug's "instant classic" on Web usability, but people are ......一起来看看 《Don't Make Me Think》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具