Easy Tutorial
❮ Php Ref Ftp Func Xml Parser Create Ns ❯

PHP strrpos() Function

PHP String Reference Manual

Example

Find the last occurrence of "php" in the string:


Definition and Usage

The strrpos() function finds the position of the last occurrence of a string within another string (case-sensitive).

Note: The strrpos() function is case-sensitive.

Related functions:


Syntax

Parameter Description
string Required. Specifies the string to search.
find Required. Specifies the character to find.
start Optional. Specifies the position to start the search from.

Technical Details

Return Value: Returns the position of the last occurrence of a string within another string, or FALSE if the string is not found. Note: String positions start at 0, not 1.
PHP Version: 4+
--- ---
Changelog: Since PHP 5.0, the find parameter can be a string of more than one character. <br> <br>In PHP 5.0, the start parameter was added.
--- ---
❮ Php Ref Ftp Func Xml Parser Create Ns ❯