English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP strripos() Function Usage and Example

   PHP String Manual

The strripos() function is used for

Syntax

strripos(string,find,start)

Definition and Usage

The strripos() function finds the last occurrence position of the string in another string (case-insensitive).

Note:The strripos() function is case-insensitive.

Related Functions:

  • stripos() - Find the first occurrence position of the string in another string (case-insensitive)

  • strpos() - Find the first occurrence position of the string in another string (case-sensitive)

  • strrpos() - Find the position of the last occurrence of the string in another string (case-sensitive)

Return Value

It returns the position of the last occurrence of the string in another string, or false if the string is not found

Parameter

Serial NumberParameters and Descriptions
1

string

It specifies the string to be searched for

2

find

It specifies the string to be searched

3

start

It specifies where to start

Online Example

Try the following example, find "w3codebox" the last occurrence position in the string:

<?php
   //Find "w3codebox" the last occurrence position in the string
   echo  strripos("oldtoolbag.com  www.oldtoolbag.com","w3codebox");
?>
Test and see‹/›

Output Results

14

PHP String Manual