PHP is_array()
函数用于检查变量是否为数组。
如果变量是数组,则此 is_array()
函数将返回 true,否则返回 false。
<?php $yes = array('this', 'is', 'an array'); echo is_array($yes) ? 'Array' : 'not an Array'; $no = 'this is a string'; echo is_array($no) ? 'Array' : 'not an Array'; ?>
输出:
Array not an Array
日期:2020-09-17 00:10:27 来源:oir作者:oir