PHP strrchr() Function

P
PHP strpos() Function
PHP strrev() Function

what is the syntax of the STRRCHR() function in php?

strrchr(string,char)
ParameterDescription
stringRequired. Specifies the string to search
charRequired. Specifies the string to find. If this is a number, it will search for the character matching the ASCII value of that number
PHP STRRCHR() method

examples of the STRRCHR() function

Example 1. In this example, we search a string for “world”, and return all characters from this position to the end of the string.

<?php
echo strrchr("Hello world!","world");
?>

Example 2. In this example, we search a string for “What”, and return all characters from this position to the end of the string.

<?php
echo strrchr("Hello world! What a beautiful day!", "What");
?>

Example 2. In this example, search a string for the ASCII value of “e” (101) and return all characters from this position to the end of the string.

<?php
echo strrchr("Hello world!",101);
?>
PHP strpos() Function
PHP strrev() Function

Add comment

Tutor Network

Share this

Learn PHP from A to Z