The strrchr() function is used to find the last occurrence of a character in a string.
Syntax
strrchr(str, char)
Parameters
str − The string to search
char − The character to find in the string. If char contains more than one character, then only the first is used.
Return
The strrchr() function returns all characters from the last occurrence of a string within another string, to the end of the main string. It returns FALSE if the character is not found.
Example
The following is an example −
<?php echo strrchr("Welcome to the web","web"); ?>
Output
web