The PHP stristr of function of case insensitive string lookup
- 2020-03-31 20:48:22
- OfStack
If the search succeeds, the rest of the string is returned (from the match point), or false if the string is not found.
Version support: PHP 3+
Grammar:
Stristr (string, find)
Description:
The string must be. Specifies the string to be searched.
Find a necessity. Specifies the characters to look for. If the parameter is a number, the character matching the ASCII value of the number is searched.
Tip:
This function is binary safe.
This function is case-insensitive. For case-sensitive searches, use STRSTR ().
Example:
Example 1
Output:
World!
Example 2
Output:
O world!
Version support: PHP 3+
Grammar:
Stristr (string, find)
Description:
The string must be. Specifies the string to be searched.
Find a necessity. Specifies the characters to look for. If the parameter is a number, the character matching the ASCII value of the number is searched.
Tip:
This function is binary safe.
This function is case-insensitive. For case-sensitive searches, use STRSTR ().
Example:
Example 1
<?php
echo stristr("Hello world!","WORLD");
?>
Output:
World!
Example 2
<?php
echo stristr("Hello world!",111);
?>
Output:
O world!