Name
array_search
Synopsis
mixed array_search(mixedvalue
, arrayarray
[, boolstrict
])
Performs a search for a value in an array, as with in_array()
. If the value is found, the key
of the matching element is returned; NULL
is returned if the value is not found.
If strict
is specified and is true
, a matched element is returned only
when it is of the same type and value as
value
.
Get Programming PHP, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.