Using the following example, what is the best way to find out the current key of $mainArray (i.e. need to check if the pointer is either at 1, 2 or 3), need to use some kind of conditional statements within the second nested foreach, depending on what the current key is of $mainArray.
$mainArray = array
(
1 => array('A1'
),
2 => array('B1',
'B2',
'B3',
'B4',
'B5'
),
3 => array('C1',
'C2',
'C3',
'C4',
'C5'
)
);
foreach ($mainArray as $subArray)
{
foreach ($subArray as $key=>$value)
{
if ([I][COLOR="Red"]$mainArray is equal to whatever number[/COLOR][/I])
{
[I][COLOR="Red"]do something;[/COLOR][/I]
}
}
}