The phpstrpos () function is used to find the position where the string appears for the first time in another string. This article introduces the phpstrpos () function usage and basic usage examples to the coders, for more information, see. Definition and usage
The strpos () function is used to locate the first occurrence of a string in another string.
Note: The strpos () function is case sensitive.
Note: This function is binary secure.
Related functions:
- Stripos ()-searches for the position of the string that appears for the first time in another string (case insensitive)
- Strripos ()-locate the last occurrence of a string in another string (case insensitive)
- Strrpos ()-locate the last occurrence of a string in another string (case sensitive)
Syntax
strpos(string,find,start)
Parameters |
Description |
String |
Required. Specifies the string to be searched. |
Find |
Required. Specifies the string to be searched. |
Start |
Optional. Specifies where to start searching. |
Return value
Return value: |
Returns the position where the string appears for the first time in another string. If no string is found, FALSE is returned. Note: The string position starts from 0, not from 1. |
PHP version: |
4 + |
Instance