Php Basics -- stristr () function PHPstristr () function PHPString function definition and usage stristr () function to find the position where the string first appears in another string. If successful, the rest of the string is returned (from the matching point ). If this string is not found, false is returned. Basic php syntax-stristr () function
PHP stristr () function
PHP String function
Definition and usage
The stristr () function is used to locate the first occurrence of a string in another string.
If successful, the rest of the string is returned (from the matching point ). If this string is not found, false is returned.
Syntax
stristr(string,search)
Parameter description
| String |
Required. Specifies the string to be searched. |
| Find |
Required. Specifies the characters to be searched. If this parameter is a number, search for characters matching the ASCII value of the number. |
Tips and comments
Note: This function is binary secure.
Note: This function is case insensitive. For case-sensitive searches, use? Strstr ().
Example 1
stristr("Hello world!","WORLD");?>
Output:
world!
Example 2
stristr("Hello world!",111);?>
Output:
o world!
?