if(count($avail) == count($avail, 1)){ echo ‘一维数组’;}else{ echo ‘多维’;}count第二个参数 添加1或者COUNT_RECURSIVE,count()会递归地计算该数组。