• PHP Video Tutorials

PHP - Function Strrchr



Syntax

strrchr(string,char)

Definition and Usage

It is used to find the last occurrence of a character in a string.

Return Values

It returns the position of last occurrence of a string inside another string or else false if string is not found

Parameters

Sr.No Parameters & Discription
1

string

It specifies string to search

2

char

It specifies string to find

Example

Try out the following example

<?php
   echo strrchr("sairam krishan!","krishan");
?>

This will produce following result −

krishan
php_function_reference.htm
Advertisements