相关疑难解决方法(0)

PHP - 检查数组索引是否存在或为空

有没有办法检查数组索引是否存在或为空? isset()不会告诉您索引是否存在或存在但是为空.如果我这样做:isset($array[$index]) || is_null($array[$index])它将无法工作,因为如果索引不存在,is_null将崩溃.

我该怎么办?还有一种方法可以检查是否存在某些东西,无论它是否设置为null?

php arrays indexing null isset

20
推荐指数
3
解决办法
4万
查看次数

标签 统计

arrays ×1

indexing ×1

isset ×1

null ×1

php ×1