How to use strrchr in PHP

In this article I will explain how strrchr function used in PHP.
  • 1353

strrchr() Function

This function search the position of the last occurrence of a string within other string, and give all characters from the last position of the string.

Syntax

strrchr(string,char)

 

 Parameter  Description
 string  String to be search
 char  It specifies the string to find. If it is a number, it will search for the character matching to the ASCII value of the number.

Example

<html>
<body>
<?php
echo strrchr("Hello india!",111);
?> <?php
echo strrchr("good morning!","morning");
?>
</body>
</html>

Output

strrchr-php.jpg

You may also want to read these related articles Click here

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.