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 −

Live Demo

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

Output

8

Updated on: 30-Jul-2019

74 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements