In PHP, The stristr () function is used to find another string in one string.
In PHP, The stristr () function is used to find another string in one string.
If the search is successful, the rest of the string (from the matching point) is returned. If the string is not found, false is returned.
Supported versions: PHP 3 +
Syntax:
Stristr (string, find)
Note:
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:
This function is binary secure.
This function is case insensitive. Use strstr () for case-sensitive searches ().
Example:
Example 1
The Code is as follows:
Echo stristr ("Hello world! "," WORLD ");
?>
Output:
World!
Example 2
The Code is as follows:
Echo stristr ("Hello world! ", 111 );
?>
Output:
O world!