Welcome to the Linux community forum and interact with 2 million technical staff to enter the usage of strstr function in php: strstr () function to search for the first occurrence of a string in another string. This function returns the rest of the string (from the matching point ). If the searched string is not found, false is returned. Syntax strstr (
Welcome to the Linux community forum and interact with 2 million technical staff> Go To The strstr function usage in php: strstr () function to search for the string that appears for the first time in another string. This function returns the rest of the string (from the matching point ). If the searched string is not found, false is returned. Syntax strstr (
Welcome to the Linux community forum and interact with 2 million technicians>
Usage of strstr function in php:
The strstr () function searches for the first occurrence of a string in another string.
This function returns the rest of the string (from the matching point ). If the searched string is not found, false is returned.
Syntax
Strstr (string, search) parameter description
String is required. Specifies the string to be searched.
Search is required. Specifies the string to be searched. If this parameter is a number, search for characters that match the ASCII value of the number.
Tips and comments
Note: This function is binary secure.
Note: This function is case sensitive. To perform case-insensitive searches, use the stristr () function.
Example 1:
Echo strstr ("Hello world! "," World ");
?>
Output:
World!
Example 2:
In this example, we will search for the characters represented by the ASCII Value of "o:
Echo strstr ("Hello world! ", 111 );
?>
Output:
O world!