I got a problem.. I am trying to compare a variable to the elements of in a subarray in a multidimensional array. If there is a match I want to print the keyname of that array. How?
Example:
$fake_array = array(
'first' => array(1,2,3),
'second' => array(4,5,6),
'third' => array(7,8,9)
);
i do a
$num = 1;
foreach($fake_array as $value) {
if (in_array($num, $value))
and I want to find it in the 'first' subarray so I want to print the word name of the key: first. How do I extract that info?
Thanks!