PHP

PHP Menu

PHP

strrchr() Function - Definition, Syntax, Parameters, Examples

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");

Introduction

PHP Basics

PHP Advance

PHP OOP

PHP Functions and Methods