My array looks like this:
$myarr = array(
1 => array(2, 4, 6, 7, 10, 11),
2 => array(95, 5, 8, 15, 21)
);
Is it possible to search thru the array for eg. for the 8 and then return the key number under which the value was located?
Eg. 95 is inside of the key no. 2, then if it does found the 95 it should return 2 – and FALSE otherwise. Another example: the 11 was found inside of the key no. 1, then it should return 1 and FALSE otherwise.
Is there a such PHP function for this?
I think you’re looking for array_walk() and/or array_walk_recursive().