Finding another string in a string can use either Strstr (), STRCHR (), STRRCHR (), STRISTR () four functions.
The function strstr () is the most common, and the function prototype is:
Strstr (String,search,before_search)//string the string to be searched, the string searched for by search, the Boolean value of the Before_search default value "false", and if set to "true", It returns the part of the string that precedes the first occurrence of the search parameter.
Cases:
Echo strstr ("I Love Shanghai", "Love");//return value is "Love Shanghai"
The function strchr () is exactly the same as the function strstr ().
function Stristr () is almost the same as the function strstr (), the difference between them is that the STRSTR () target keyword string is case-sensitive, and the target keyword string of stristr () is not case-sensitive;
The function strrchr () is also almost identical to the function strstr (), but STRRCHR () returns the searched string from before the position of the last occurrence of the target keyword.