lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at
PHP: array_search()
Problem: given the array value where the array is associative, find the key.

I always blank on this. Very simple:

mixed array_search ( mixed needle, array haystack [, bool strict] )

For example:

$key = array_search($value, $ARRAY);