Answer the question
In order to leave comments, you need to log in
How to check if a nested key exists in an array in PHP?
I have a class with an EXIST() method
class X{
private $data = ['a'=>['b'=>123], 1 => []];
public function exists($name) {
return isset($this->data[$name]);
}
}
$this->data = ['a'=>['b'=>123], 1 => []]
'b'
Answer the question
In order to leave comments, you need to log in
need to find b in any nested array (leaves or branches) or specifically in leaves?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question