Through
PHP stristr () function -- finds the position of the string that appears for the first time in another string.
Define and use the PHP 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.
Syntax stristr (string, search)
Parameters and descriptions
String is required. Specifies the string to be searched.
Find is required. Specifies the characters to be searched. If this parameter is a number, search for characters matching the ASCII value of the number.
Tip and comment: this function is binary secure.
Note: This function is case insensitive. Use strstr () for case-sensitive searches ().
Example 1 of the PHP stristr () function
- <? Php
- Echo stristr ("Hello world! "," WORLD ");
-
- ?>
Output:
World!
PHP stristr () function Example 2
- <? Php
- Echo stristr ("Hello world! ", 111 );
- ?>
-
Output:
O world!