array_search() is a built in PHP function that searches the array for a given value and returns the first corresponding key if successful.
Syntax array_search ( mixed $needle , array $haystack [, bool $strict = FALSE ] ) : mixed Support: (PHP 4 >= 4.