2 /* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
3 * Description: Find position of first occurrence of a case-insensitive string
4 * Source code: ext/standard/string.c
7 /* Test stripos() function by passing double quoted strings for 'haystack' & 'needle' arguments */
9 echo "*** Testing stripos() function: with double quoted strings ***\n";
10 $haystack = "Hello,\t\n\0\n $&!#%\o,()*+-./:;<=>?@hello123456he \x234 \101 ";
62 "12345", //decimal numeric string
63 "\x23", //hexadecimal numeric string
64 "#", //respective ASCII char of \x23
65 "\101", //octal numeric string
66 "A", //respective ASCII char of \101
67 "456HEE", //numerics + chars
68 $haystack //haystack as needle
71 /* loop through to get the position of the needle in haystack string */
73 for($index=0; $index<count($needle); $index++
) {
74 echo "-- Iteration $count --\n";
75 var_dump( stripos($haystack, $needle[$index]) );
76 var_dump( stripos($haystack, $needle[$index], $index) );