Computer >> Computer tutorials >  >> Programming >> PHP

strripos() function in PHP


The strripos() function is used find the position of the last occurrence of a string inside the another string.

Note − The function is case-insensitive.

Syntax

striipos(str, find, begin)

Parameters

  • str − The string to search. Required.

  • find − The string to find. Required.

  • begin − Where to begin the search. Optional.

Return

The strripos() function returns the position of first occurrence of a string inside another string or else false if string is not found.

Example

The following is an example −

<?php
   echo strripos("This is demo text !","DEMO");
?>

Output

8