PHP’s array_search() does this:
Searches the array for a given value and returns the corresponding key if successful
I would like a function that does the exact opposite, that is, searches the array for a given key and returns the corresponding value if successful.
Is this available at all in PHP 5? If not, what solution would you suggest?
You can just use square bracket syntax, as follows: