strrpos
Calculate the last occurrence of the specified string in the target string
strrpos()
function finds where the string last appears in another string.
Note: strrpos()
function is case sensitive.
stripos()
- Find where the string first appears in another string (case insensitive)strpos()
- Find where the string first appears in another string (case sensitive)strripos()
- Find the last occurrence of a string in another string (case insensitive)Find the last occurrence of "php" in the string:
<?php echo strrpos ( "You love php, I love php too!" , "php" ) ; ?>
Try it yourself
strrpos ( string , find , start )
parameter | describe |
---|---|
string | Required. Specifies the string being searched. |
Find | Required. Specifies the characters to be searched. |
start | Optional. Specify where to start the search. |