Instance
Find the last occurrence of "PHP" in the string:
<?phpecho Strripos ("I love php, I love php too!", "PHP"); >
Definition and usage
The Strripos () function finds the position of the last occurrence of a string in another string (case insensitive).
Note: the Strripos () function is case insensitive.
Related functions:
Stripos ()-finds the position of the first occurrence of a string in another string (case insensitive)
Strpos ()-finds the position of the first occurrence of a string in another string (case-sensitive)
Strrpos ()-Finds the last occurrence of a string in another string (case-sensitive)
Grammar
Strripos (String,find,start)
parameters |
description |
string |
required. Specifies the string to be searched. |
find |
start |
optional. Specify where to start the search. |
technical details
return value: |
Returns the position of the last 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+ |
Update log: |
From PHP 5.0, the find parameter can be a string that is more than one character long.
In PHP 5.0, the start parameter has been added. |
Instance
Find the last occurrence of "Java" in a string:
<?phpecho strripos ("What's Java and what's php?", "Java");