Definition
The strrchr() function finds the position of the last occurrence of a string within another string, and returns all characters from this position to the end of the string.
Syntax
strrchr(string, char)
Parameters
Parameter | Description |
---|---|
string |
Required. Specifies the string to search. |
char |
Required. Specifies the string to find. If this is a number, it will search for the character matching the ASCII value of that number. |
Example
<?php
echo strrchr("Welcome to the PHP Tutorials! Learn PHP quickly!", "PHP");