1$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
2
3$key = array_search('green', $array); // $key = 2;
4$key = array_search('red', $array); // $key = 1;
1$array = array('foo' => 'bar', 33 => 'bin', 'lorem' => 'ipsum');
2$array = array_values($array);
3echo $array[0]; //bar
4echo $array[1]; //bin
5echo $array[2]; //ipsum
6