PHP Basic Learning--STRISTR () function
PHP stristr () function
PHP String function
Definition and usage
The Stristr () function finds the position of the first occurrence of a string in another string.
If successful, returns the remainder of the string (from the matching point). If the string is not found, false is returned.
Grammar
Stristr (String,search)
parameter Description
string |
required. Specifies the string to be searched. |
find |
required. Specifies the character to find. If the parameter is a number, the character that matches the ASCII value of the number is searched. |
Hints and Notes
Note: This function is binary safe.
Note: The function is not case sensitive. For case-sensitive searches, use the? Strstr ().
Example
Example 1
Stristr ("Hello world!", "World");? >
Output:
world!
Example 2
Stristr ("Hello world!", 111);? >
Output:
o world!
?