Home
last modified time | relevance | path

Searched refs:haystack (Results 1 – 25 of 198) sorted by relevance

12345678

/PHP-7.3/ext/standard/tests/strings/
H A Dstrrpos_negative_offset.phpt6 var_dump(strrpos("haystack", 'h', -8));
7 var_dump(strrpos("haystack", 'k', -1));
8 var_dump(strrpos("haystack", "ka", -1));
9 var_dump(strrpos("haystack", 'a', -3));
10 var_dump(strrpos("haystack", 'a', -4));
11 var_dump(@strrpos("haystack", 'h', -9));
H A Dstrrpos_variation8.phpt2 Test strrpos() function : usage variations - repetitive chars for 'haystack' argument
5 /* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of 'needle' in 'haystack'.
10 … Test strrpos() function with strings containing multiple occurrences of 'needle' in the 'haystack'
15 $haystack = "ababababAbaBa";
18 /* loop through to consider various offsets in getting the position of the needle in haystack strin…
20 for($offset = -1; $offset <= strlen($haystack); $offset++ ) {
22 var_dump( strrpos($haystack, $needle, $offset) );
H A Dbug60801.phpt5 $haystack = "foob\x00ar";
8 var_dump(strpbrk($haystack, 'ar'));
9 var_dump(strpbrk($haystack, "\x00"));
10 var_dump(strpbrk($haystack, $needle));
14 var_dump(strpbrk($haystack, 'xyz'));
H A Dstrripos_basic1.phpt5 /* Prototype : int strripos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack'
15 echo "\n-- regular string for haystack & needle --\n";
26 echo "\n-- heredoc string for haystack & needle --\n";
36 -- regular string for haystack & needle --
47 -- heredoc string for haystack & needle --
H A Dstrrpos_variation13.phpt5 /* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of 'needle' in 'haystack'.
15 $haystack = "\0Hello\0World\0";
28 var_dump( strrpos($haystack, $needles[$index]) );
29 var_dump( strrpos($haystack, $needles[$index], $index) );
H A Dstrrchr_basic.phpt5 /* Prototype : string strrchr(string $haystack, string $needle);
12 var_dump( strrchr("Hello, World", "Hello") ); //needle as a first word of haystack
20 //needle as second word of haystack
28 var_dump( strrchr("Hello, World", "Hello, World") ); //needle as haystack
33 //multiple existence of needle in haystack
37 var_dump( strrchr("Hello, World", "Zzzz") ); //non-existent needle in haystack
H A Dstrripos_basic2.phpt5 /* Prototype : int strripos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack'
15 echo "\n-- regular string for haystack & needle, with various offsets --\n";
21 echo "\n-- heredoc string for haystack & needle, with various offsets --\n";
42 -- regular string for haystack & needle, with various offsets --
48 -- heredoc string for haystack & needle, with various offsets --
H A Dstrrpos_variation1.phpt2 Test strrpos() function : usage variations - double quoted strings for 'haystack' & 'needle' argume…
5 /* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of 'needle' in 'haystack'.
10 /* Test strrpos() function by passing double quoted strings for 'haystack' & 'needle' arguments */
13 $haystack = "Hello,\t\n\0\n $&!#%()*<=>?@hello123456he \x234 \101 ";
62 $haystack //haystack as needle
65 /* loop through to get the position of the needle in haystack string */
69 var_dump( strrpos($haystack, $needle[$index]) );
70 var_dump( strrpos($haystack, $needle[$index], $index) );
H A Dstrrchr_variation7.phpt2 Test strrchr() function : usage variations - heredoc string containing blank line for 'haystack'
5 /* Prototype : string strrchr(string $haystack, string $needle);
11 * blank-line for haystack and with various needles
26 $blank_line //needle as haystack
H A Dstrrpos_variation5.phpt2 Test strrpos() function : usage variations - heredoc string containing escape chars for 'haystack' …
5 /* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of 'needle' in 'haystack'.
10 /* Test strrpos() function by passing heredoc string containing escape chars for haystack
H A Dstrpbrk_error.phpt5 /* Prototype : array strpbrk(string haystack, string char_list)
13 $haystack = 'This is a Simple text.';
18 var_dump( strpbrk($haystack, $char_list, $extra_arg) );
21 var_dump( strpbrk($haystack) );
24 var_dump( strpbrk($haystack, '') );
27 var_dump( strpbrk($haystack, array('a', 'b', 'c') ) );
H A Dstrrpos_variation2.phpt2 Test strrpos() function : usage variations - single quoted strings for 'haystack' & 'needle' argume…
5 /* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of 'needle' in 'haystack'.
10 /* Test strrpos() function by passing single quoted strings to 'haystack' & 'needle' arguments */
13 $haystack = 'Hello,\t\n\0\n $&!#%()*<=>?@hello123456he \x234 \101 ';
63 $haystack //haystack as needle
66 /* loop through to get the position of the needle in haystack string */
70 var_dump( strrpos($haystack, $needle[$index]) );
71 var_dump( strrpos($haystack, $needle[$index], $index) );
H A Dstrrchr_variation3.phpt2 Test strrchr() function : usage variations - multi line heredoc string for 'haystack'
5 /* Prototype : string strrchr(string $haystack, string $needle);
10 /* Test strrchr() function by passing multi-line heredoc string for haystack and
25 $multi_line_str //needle as haystack
H A Dstrripos_variation5.phpt2 Test strripos() function : usage variations - heredoc string containing escape chars for 'haystack'…
5 /* Prototype : int strripos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of a case-insensitive 'needle' in a 'haystack'
10 /* Test strripos() function by passing heredoc string containing escape chars for haystack
H A Dstrrpos_variation12.phpt2 Test strrpos() function : usage variations - checking binary safe with 'haystack' argument
5 /* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of 'needle' in 'haystack'.
10 /* Test strrpos() function with null terminated strings for 'haystack' argument
H A Dstrrpos_variation3.phpt2 Test strrpos() function : usage variations - multi line heredoc string for 'haystack' argument
5 /* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of 'needle' in 'haystack'.
10 /* Test strrpos() function by passing multi-line heredoc string for haystack and
/PHP-7.3/ext/intl/tests/
H A Dbug61860.phpt7 $haystack = 'Auf der Straße nach Paris habe ich mit dem Fahrer gesprochen';
9 grapheme_stripos($haystack, 'pariS '),
10 grapheme_stristr($haystack, 'paRis '),
11 grapheme_substr($haystack, grapheme_stripos($haystack, 'Paris'))
/PHP-7.3/ext/intl/grapheme/
H A Dgrapheme_string.c112 char *haystack, *needle; in PHP_FUNCTION() local
146 found = php_memnstr(haystack + noffset, needle, needle_len, haystack + haystack_len); in PHP_FUNCTION()
155 RETURN_LONG(found - haystack); in PHP_FUNCTION()
175 char *haystack, *needle; in PHP_FUNCTION() local
245 char *haystack, *needle; in PHP_FUNCTION() local
308 char *haystack, *needle; in PHP_FUNCTION() local
596 char *haystack, *needle; in strstr_common_handler() local
623 found = php_memnstr(haystack, needle, needle_len, haystack + haystack_len); in strstr_common_handler()
632 size_t found_offset = found - haystack; in strstr_common_handler()
635 RETURN_STRINGL(haystack, found_offset); in strstr_common_handler()
[all …]
/PHP-7.3/ext/mbstring/tests/
H A Dmb_stripos_basic2.phpt10 /* Prototype : int mb_stripos(string haystack, string needle [, int offset [, string encoding]])
58 foreach ($ascii_haystacks as $haystack) {
59 var_dump(mb_stripos($haystack, $needle));
60 var_dump(mb_stripos($haystack, $needle, 6));
66 foreach ($greek_haystacks as $haystack) {
67 var_dump(mb_stripos($haystack, $needle));
68 var_dump(mb_stripos($haystack, $needle, 4));
H A Dmb_strripos_basic2.phpt10 /* Prototype : int mb_strripos(string haystack, string needle [, int offset [, string encoding]])
58 foreach ($ascii_haystacks as $haystack) {
59 var_dump(mb_strripos($haystack, $needle));
60 var_dump(mb_strripos($haystack, $needle, 14));
66 foreach ($greek_haystacks as $haystack) {
67 var_dump(mb_strripos($haystack, $needle));
68 var_dump(mb_strripos($haystack, $needle, 12));
H A Dmb_strripos_variation5_Bug45923.phpt10 /* Prototype : int mb_strripos(string haystack, string needle [, int offset [, string encoding]])
77 Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
81 Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
87 Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
91 Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
97 Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
101 Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
107 Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
111 Warning: mb_strripos(): Offset is greater than the length of haystack string in %s on line %d
H A Dbug43841.phpt10 /* Prototype : int mb_strrpos(string $haystack, string $needle [, int $offset [, string $encoding]…
40 Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
45 Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
49 Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
55 Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
60 Warning: mb_strrpos(): Offset is greater than the length of haystack string in %s on line %d
64 Warning: strrpos(): Offset is greater than the length of haystack string in %s on line %d
H A Dmb_substr_count_variation4.phpt2 Test mb_substr_count() function : variation - pass a $needle that overlaps in $haystack
10 /* Prototype : int mb_substr_count(string $haystack, string $needle [, string $encoding])
16 * Pass mb_substr_count() a $needle that overlaps in $haystack and see whether
26 var_dump(mb_substr_count($string_ascii, 'abcabc')); //needle overlaps in haystack
/PHP-7.3/ext/standard/tests/array/
H A Darray_search_variation2.phpt2 Test array_search() function : usage variations - different haystack values
6 * Prototype : mixed array_search ( mixed $needle, array $haystack [, bool $strict] )
7 …* Description: Searches haystack for needle and returns the key if it is found in the array, FALSE…
11 /* Test array_search() with different possible haystack values */
13 echo "*** Testing array_search() with different haystack values ***\n";
53 *** Testing array_search() with different haystack values ***
H A Din_array_variation2.phpt2 Test in_array() function : usage variations - different haystack values
6 * Prototype : bool in_array ( mixed $needle, array $haystack [, bool $strict] )
7 * Description: Searches haystack for needle and returns TRUE
12 /* Test in_array() with different possible haystack values */
14 echo "*** Testing in_array() with different haystack values ***\n";
53 *** Testing in_array() with different haystack values ***

Completed in 33 milliseconds

12345678