-
Notifications
You must be signed in to change notification settings - Fork 15
array_search
Chung Leong edited this page Jan 10, 2022
·
4 revisions
array_search - Checks if a value exists in an array
int32 array_search ( mixed $needle, array $haystack )
array_search() searches haystack for needle and returns its position.
needle - The searched value. If haystack is a one-dimensional array, then needle should be a scalar. If haystack is a multi-dimensional array, then needle of should be an array of the same size as the subarrays of haystack. The size of needle must be known at compile-time. It cannot be an expandable array.
haystack - The array to perform the search on.
The array index at which needle was found or -1 if needle does not appear in haystack.
Unlike in regular PHP, array_search() returns -1 on failure in PHP+QB and not false.
1.0 and above.