-
Notifications
You must be signed in to change notification settings - Fork 15
array_pos
Chung Leong edited this page Jan 10, 2022
·
4 revisions
array_pos — Find the position of the first occurrence of a array in an array
int32 array_pos ( array $haystack, array $needle [, int32 $offset] )
array_pos() finds the numeric position of the first occurence of needle in haystack. It's the generalized version of [strpos].
haystack - The array to perform the search on.
needle - The "sub-string" to look for.
offset - If specified, search will start this number of elements from the beginning of haystack.
The position of where needle exists relative to the beginning of haystack (independent of offset). If needle does not appear in haystack, the return value is -1.
Unlike strpos() in regular PHP, array_pos() returns -1 on failure in PHP+QB and not false.
1.0 and above.