Home
last modified time | relevance | path

Searched refs:needle (Results 1 – 25 of 131) sorted by relevance

123456

/PHP-7.4/ext/standard/tests/strings/
H A Dbug60801.phpt6 $needle = "a\x00b";
10 var_dump(strpbrk($haystack, $needle));
11 var_dump(strpbrk('foobar', $needle));
12 var_dump(strpbrk("\x00", $needle));
13 var_dump(strpbrk('xyz', $needle));
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";
22 echo "\n-- single char for needle --\n";
26 echo "\n-- heredoc string for haystack & needle --\n";
36 -- regular string for haystack & needle --
43 -- single char for needle --
47 -- heredoc string for haystack & needle --
H A Dstrrchr_basic.phpt5 /* Prototype : string strrchr(string $haystack, string $needle);
11 var_dump( strrchr("Hello, World", "H") ); //needle as single char
12 var_dump( strrchr("Hello, World", "Hello") ); //needle as a first word of haystack
20 //needle as second word of haystack
24 //needle as special char
28 var_dump( strrchr("Hello, World", "Hello, World") ); //needle as haystack
30 //needle string containing one existing and one non-existing char
33 //multiple existence of needle in haystack
37 var_dump( strrchr("Hello, World", "Zzzz") ); //non-existent needle in haystack
H A Dstristr_error.phpt6 /* Prototype: string stristr ( string $haystack , mixed $needle [, bool $before_needle ] )
15 echo "\n-- Testing stristr() function with no needle --\n";
16 var_dump( stristr("Hello World") ); // without "needle"
25 echo "\n-- Testing stristr() function with empty needle --\n";
41 -- Testing stristr() function with no needle --
53 Warning: stristr(): Empty needle in %s on line %d
56 -- Testing stristr() function with empty needle --
58 Warning: stristr(): Empty needle in %s on line %d
H A Dstrrpos_variation8.phpt5 /* 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 'haystac…
16 $needle = "aba";
18 /* loop through to consider various offsets in getting the position of the needle in haystack strin…
22 var_dump( strrpos($haystack, $needle, $offset) );
H A Dstrrchr_variation4.phpt5 /* Prototype : string strrchr(string $haystack, string $needle);
31 $heredoc_needle, //needle as heredoc string
32 $special_chars_str //needle as haystack
35 //loop through to test strrchr() with each needle
36 foreach($needles as $needle) {
37 var_dump( strrchr($special_chars_str, $needle) );
H A Dstrrchr_variation7.phpt5 /* Prototype : string strrchr(string $haystack, string $needle);
26 $blank_line //needle as haystack
29 //loop through to test strrchr() with each needle
30 foreach($needles as $needle) {
31 var_dump( strrchr($blank_line, $needle) );
H A Dstrrchr_variation3.phpt5 /* Prototype : string strrchr(string $haystack, string $needle);
25 $multi_line_str //needle as haystack
28 //loop through to test strrchr() with each needle
29 foreach($needles as $needle) {
30 var_dump( strrchr($multi_line_str, $needle) );
H A Dstrrchr_variation6.phpt5 /* Prototype : string strrchr(string $haystack, string $needle);
26 $quote_char_str //needle as haystack
29 //loop through to test strrchr() with each needle
30 foreach($needles as $needle) {
31 var_dump( strrchr($quote_char_str, $needle) );
H A Dstrrpos_basic1.phpt5 /* Prototype : int strrpos ( string $haystack, string $needle [, int $offset] );
6 * Description: Find position of last occurrence of 'needle' in 'haystack'
16 //regular string for haystack & needle
22 //single char for needle
26 //heredoc string for haystack & needle
H A Dstripos_basic1.phpt5 /* Prototype : int stripos ( string $haystack, string $needle [, int $offset] );
16 //regular string for haystack & needle
22 //single char for needle
26 //heredoc string for haystack & needle
31 //non-existing needle in haystack
H A Dstrrchr_variation5.phpt5 /* Prototype : string strrchr(string $haystack, string $needle);
25 $escape_char_str //needle as haystack
28 //loop through to test strrchr() with each needle
29 foreach($needles as $needle) {
30 var_dump( strrchr($escape_char_str, $needle) );
H A Dstrrchr_variation8.phpt5 /* Prototype : string strrchr(string $haystack, string $needle);
24 $empty_str //needle as haystack
27 //loop through to test strrchr() with each needle
28 foreach($needles as $needle) {
29 var_dump( strrchr($empty_str, $needle) );
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_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 */
14 $needle = array(
62 42, //needle as int(ASCII value of '*')
63 $haystack //haystack as needle
66 /* loop through to get the position of the needle in haystack string */
68 for($index=0; $index<count($needle); $index++) {
70 var_dump( strrpos($haystack, $needle[$index]) );
[all …]
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 */
14 $needle = array(
62 $haystack //haystack as needle
65 /* loop through to get the position of the needle in haystack string */
67 for($index=0; $index<count($needle); $index++) {
69 var_dump( strrpos($haystack, $needle[$index]) );
70 var_dump( strrpos($haystack, $needle[$index], $index) );
/PHP-7.4/ext/mbstring/tests/
H A Dmb_stripos_basic.phpt74 echo "\n -- ASCII Strings, needle should be found --\n";
75 foreach ($ascii_needles as $needle) {
76 if ($needle == '!') {
81 var_dump(mb_stripos($haystack, $needle));
87 foreach ($greek_needles as $needle) {
88 if ($needle == '!') {
93 var_dump(mb_stripos($haystack, $needle));
103 -- ASCII Strings, needle should be found --
117 -- ASCII Strings, needle should not be found --
131 -- Greek Strings, needle should be found --
[all …]
H A Dmb_strripos_basic.phpt74 echo "\n -- ASCII Strings, needle should be found --\n";
75 foreach ($ascii_needles as $needle) {
76 if ($needle == '!') {
81 var_dump(mb_strripos($haystack, $needle));
87 foreach ($greek_needles as $needle) {
88 if ($needle == '!') {
93 var_dump(mb_strripos($haystack, $needle));
103 -- ASCII Strings, needle should be found --
117 -- ASCII Strings, needle should not be found --
131 -- Greek Strings, needle should be found --
[all …]
H A Dmb_strrchr_basic.phpt10 /* Prototype : string mb_strrchr(string haystack, string needle[, bool part[, string encoding]])
24 echo "\n-- ASCII string: needle exists --\n";
30 echo "\n-- ASCII string: needle doesn't exist --\n";
33 echo "\n-- Multibyte string: needle exists --\n";
40 echo "\n-- Multibyte string: needle doesn't exist --\n";
49 -- ASCII string: needle exists --
54 -- ASCII string: needle doesn't exist --
57 -- Multibyte string: needle exists --
62 -- Multibyte string: needle doesn't exist --
H A Dmb_strstr_basic.phpt10 /* Prototype : string mb_strstr(string haystack, string needle[, bool part[, string encoding]])
24 echo "\n-- ASCII string: needle exists --\n";
30 echo "\n-- ASCII string: needle doesn't exist --\n";
33 echo "\n-- Multibyte string: needle exists --\n";
40 echo "\n-- Multibyte string: needle doesn't exist --\n";
49 -- ASCII string: needle exists --
54 -- ASCII string: needle doesn't exist --
57 -- Multibyte string: needle exists --
62 -- Multibyte string: needle doesn't exist --
H A Dmb_stristr_basic.phpt10 /* Prototype : string mb_stristr(string haystack, string needle[, bool part[, string encoding]])
31 echo "\n-- ASCII string: needle exists --\n";
37 echo "\n-- ASCII string: needle doesn't exist --\n";
40 echo "\n-- Multibyte string: needle exists --\n";
46 echo "\n-- Multibyte string: needle doesn't exist --\n";
55 -- ASCII string: needle exists --
60 -- ASCII string: needle doesn't exist --
63 -- Multibyte string: needle exists --
68 -- Multibyte string: needle doesn't exist --
H A Dmb_strrichr_basic.phpt10 /* Prototype : string mb_strrichr(string haystack, string needle[, bool part[, string encoding]])
31 echo "\n-- ASCII string: needle exists --\n";
37 echo "\n-- ASCII string: needle doesn't exist --\n";
40 echo "\n-- Multibyte string: needle exists --\n";
46 echo "\n-- Multibyte string: needle doesn't exist --\n";
55 -- ASCII string: needle exists --
60 -- ASCII string: needle doesn't exist --
63 -- Multibyte string: needle exists --
68 -- Multibyte string: needle doesn't exist --
H A Dmb_stripos_basic2.phpt10 /* Prototype : int mb_stripos(string haystack, string needle [, int offset [, string encoding]])
57 foreach ($ascii_needles as $needle) {
59 var_dump(mb_stripos($haystack, $needle));
60 var_dump(mb_stripos($haystack, $needle, 6));
65 foreach ($greek_needles as $needle) {
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]])
57 foreach ($ascii_needles as $needle) {
59 var_dump(mb_strripos($haystack, $needle));
60 var_dump(mb_strripos($haystack, $needle, 14));
65 foreach ($greek_needles as $needle) {
67 var_dump(mb_strripos($haystack, $needle));
68 var_dump(mb_strripos($haystack, $needle, 12));
/PHP-7.4/ext/intl/grapheme/
H A Dgrapheme_string.c110 char *haystack, *needle; in PHP_FUNCTION() local
173 char *haystack, *needle; in PHP_FUNCTION() local
207 needle_dup = estrndup(needle, needle_len); in PHP_FUNCTION()
222 if ( grapheme_ascii_check((unsigned char *)needle, needle_len) >= 0 ) { in PHP_FUNCTION()
243 char *haystack, *needle; in PHP_FUNCTION() local
283 if ( grapheme_ascii_check((unsigned char *)needle, needle_len) >= 0 ) { in PHP_FUNCTION()
306 char *haystack, *needle; in PHP_FUNCTION() local
339 needle_dup = estrndup(needle, needle_len); in PHP_FUNCTION()
355 if ( grapheme_ascii_check((unsigned char *)needle, needle_len) >= 0 ) { in PHP_FUNCTION()
594 char *haystack, *needle; in strstr_common_handler() local
[all …]

Completed in 36 milliseconds

123456