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
  • Calculate the soundex key of a string soundex

    soundex

    Calculatethesoundexk
  • Escape metacharacter set quotemeta

    quotemeta

    Escapemetacharacters
  • Returns the formatted string sprintf

    sprintf

    Returnstheformatteds
  • Calculate the metaphone key of a string metaphone

    metaphone

    Calculatethemetaphon
  • Get the string length strlen

    strlen

    Getthestringlength
  • Convert string to lowercase strtolower

    strtolower

    Convertstringtolower
  • Parses entered characters according to the specified format sscanf

    sscanf

    Parsesenteredcharact
  • Calculate the length of the first substring in which all characters in the string exist in the specified character set strspn

    strspn

    Calculatethelengthof
Popular Articles