Tribe__Utils__Array::strpos( string $haystack, array|string $needles, int $offset )
Behaves exactly like the native strpos(), but accepts an array of needles.
Contents
See also
Parameters
- $haystack
-
(string) (Required) String to search in.
- $needles
-
(array|string) (Required) Strings to search for.
- $offset
-
(int) (Required) Starting position of search.
Return
(false|int) Integer position of first needle occurrence.
Source
File: src/Tribe/Utils/Array.php
public static function strpos( $haystack, $needles, $offset = 0 ) {
$needles = (array) $needles;
foreach ( $needles as $i ) {
$search = strpos( $haystack, $i, $offset );
if ( false !== $search ) {
return $search;
}
}
return false;
}