Home>Article>Backend Development> Is php strstr() case insensitive?
No, php strstr() is case-sensitive. strstr() is used to perform string search in a case-sensitive manner, searching whether the specified string exists in another string; if it exists, the string and the remaining part are returned, otherwise FALSE is returned.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
strstr() function searches for a string in another Whether it exists in the string, if so, return the string and the remaining part, otherwise return FALSE.
strstr() function is case-sensitive. To perform a case-insensitive search, use the stristr() function.
Syntax:
strstr(string,search,before_search)
Parameters | Description |
---|---|
string | Required. Specifies the string to be searched for. |
search | Required. Specifies the string to search for. If the argument is a number, searches for characters that match the ASCII value for that number. |
before_search | Optional. A Boolean value with a default value of "false". If set to "true", it will return the portion of the string preceding the first occurrence of thesearchparameter. |
Return value: Returns the remaining part of the string (from the matching point). Returns FALSE if the searched string is not found.
Example:
Output
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of Is php strstr() case insensitive?. For more information, please follow other related articles on the PHP Chinese website!