Current Location: Home> Function Categories> strrpos

strrpos

Calculate the last occurrence of the specified string in the target string
Name:strrpos
Category:String
Programming Language:php
One-line Description:Finds where the string last appears in another string (case sensitive).

Definition and usage

strrpos() function finds where the string last appears in another string.

Note: strrpos() function is case sensitive.

Related functions:

  • 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)

Example

Find the last occurrence of "php" in the string:

 <?php
echo strrpos ( "You love php, I love php too!" , "php" ) ;
?>

Try it yourself

grammar

 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.
Similar Functions
Popular Articles