Example
Find the location where "PHP" first appears in the string:
<?phpecho Stripos ("You love php, I love php too!", "PHP"); >
Running an instance
Definition and Usage
The Stripos () function finds the position of the first occurrence of a string in another string (case insensitive).
Note: the Stripos () function is case insensitive.
Note: This function is binary safe.
related functions:
- Strpos ()-finds the position of the first occurrence of a string in another string (case-sensitive)
- Strripos ()-Finds the last occurrence of a string in another string (case insensitive)
- Strrpos ()-Finds the last occurrence of a string in another string (case-sensitive)
Grammar
Stripos (string,find,start)
Parameters |
Description |
String |
Necessary. Specifies the string to search for. |
Find |
Necessary. Specifies the character to find. |
Start |
Optional. Specify where to start the search. |
Technical Details
return value: |
Returns the position of the first occurrence of a string in another string, or FALSE if no string is found. Note: The string position starts at 0, not from 1. |
PHP version: |
5+ |
PHP String function
PHP Reference ManualPHP Quiz
The content provided by W3school is for training only. We do not guarantee the correctness of the content. Through the use of the content of the site with the wind
PHP Stripos () function