How do I check the existence of a key in a sub-array of a multidimensional array?
Suppose I have:
$bigarray = (
$sub1 => array ('a', 'b', 'c'),
$sub2 => array ('e', 'f', 'g'),
$sub3 => array ('h', 'i', 'j')
);
$target = 'g';
if (in_array($target, $bigarray["sub2"])
{print "target found";}
// the example above works fine, but if I have MANY keys in MANY sub-arrays, I cannot just use:
$target = 'g';
if (in_array($target, $bigarray)
{print "target found";}
... or can I? How?
Thank you very much,
Luciano ES
Santos, SP - Brasil