heres something that works but its a bit more complex
$sort = array (
1 => Array (
0 => 1
,1 => 2
,2 => 3
,3 => 4
,4 => 5
)
,2 => Array (
0 => 6
,1 => 7
,2 => 8
,3 => 9
,4 => 10
)
,3 => Array (
0 => 11
,1 => 12
,2 => 13
,3 => 14
,4 => 15
)
,4 => Array (
0 => 16
,1 => 17
,2 => 18
,3 => 19
,4 => 20
)
);
$look['look']=4;
$look['found']=0;
array_walk( $sort , 'lookup' , &$look);
print_r($found);
function lookup($array_struct , $idx , &$look)
{
foreach($array_struct as $i => $value)
{
if (0 == $look['found']) {
if ( $look['look'] == $value) {
//since pass by reference this value always changes
//we can not assign idx to row because idx changes with each iteration of the array
//
ob_start();
echo $idx;
$look['row'] = ob_get_contents ();
ob_end_clean();
$look['col'] = $i;
$look['found'] = 1;
}
}
}
} // end func