How do I know if a key in an array is true? If not, then don't use this
[0] => array
(
[id] => 1
[some_key] => something
)
[1] => array
(
[id] => 2
)
[2] => array
(
[id] => 3
[some_key] => something
)
foreach($array as $value){
$id = $value->id;
if($value->some_key === TRUE){
$some_key = $value->some_key; //some may have this key, some may not
}
}
Not sure what is the proper statement to check if this array has that some_key. If I don't have a check, it will output an error message.
Thanks in advance.