I have some question about searching a value in multidimensional array. This is my code
$groep = array(
1 => array("111","222"),
2 => array("333","444")
);
$groepje = 0;
foreach($groep as $row => $value){
if(array_search($serial,$value)){
$groepje = $row;
}
}
Now i want to set $groepje to the 'head'key of the array, so if $serial = 111 it have to give back 1, if $serial = 444 it have to give back 2.
What i do get is the wrong number, so 0 if its 111 or 333.
Can someone tell me what i'm doing wrong?
Thanks!