We will encounter the case of finding the string in the actual encoding. What should we do if we need to find out where we first appear in another string? Today we introduce you to the
Definition and Usage
The PHP function Stristr () 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 is 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 Comment notes: This function is binary safe.
Note: The function is not case sensitive. For case-sensitive searches, use STRSTR ().
php function Stristr () Example 1
- < ? PHP
- Echo stristr ("Hello world!", "World");
- ?>
Output:
world!
php function Stristr () Example 2
- < ? PHP
- Echo stristr ("Hello world!", 111);
- ?>
Output:
o world!
http://www.bkjia.com/PHPjc/446289.html www.bkjia.com true http://www.bkjia.com/PHPjc/446289.html techarticle we will encounter the case of finding the string in the actual encoding. What should we do if we need to find out where we first appear in another string? Today we are ...