有没有办法检查数组索引是否存在或为空? isset()不会告诉您索引是否存在或存在但是为空.如果我这样做:isset($array[$index]) || is_null($array[$index])它将无法工作,因为如果索引不存在,is_null将崩溃.
isset()
isset($array[$index]) || is_null($array[$index])
我该怎么办?还有一种方法可以检查是否存在某些东西,无论它是否设置为null?
php arrays indexing null isset
arrays ×1
indexing ×1
isset ×1
null ×1
php ×1