I'm trying to find out the current 'numerical' position value of an array. Here is the code I have at the moment: $menu1 = array('1'=>'Entertainment', '2'=>'Venues', '3'=>'Transport', '4'=>'Catering', '5'=>'Decorations', '6'=>'Essentials'); Code (markup): foreach ($menu1 as $value1 => $index1) { //do something here foreach ($cat as $index => $value) { if ($cat[$index][0] == key($menu1) && $cat[$index][1] == $value1) { //do something here } } } Code (markup): Basically I need the value of $cat[$index][0] to match the current value of the $menu1 array as it is being accessed in the FOR loop. For example in the first cyle, $menu1 should be initialised to '1'=>'Entertainment' and hold the value of 1.
At the moment, key($menu1) doesn't seem to be matching up with the assigned values in the $menu1 array