PHP strrchr Function

What is strrchr Function?

Explanation

In PHP, this function is used to find the last occurrence of a character in a string.

Syntax:


strrchr(string,char)

In the above syntax "string" specifies the strings to be searched, "char" specifies the character to be searched for.

Example :


<?php
echo strrchr("Hello How Are You","o");
?>
Result :

ou

In the above example the character "o" is searched from the position of last occurence, then rest of the string is displayed.

PHP Topics


Ask Questions

Ask Question