Retrieve array key passed on value PHP
- by Doodle
I have the following array
$group= array(
[0] => 'apple',
[1] => 'orange',
[2] => 'gorilla'
);
I run the array group through an for each function and when the loop hits values of gorilla I want it to spit out the index of gorilla
foreach( $group as $key){
if ($key==gorilla){
echo //<------ the index of gorilla
}
}