strpos function in reverse in php strpos function in reverse in php php php

strpos function in reverse in php


int strrpos ( string $haystack , string $needle [, int $offset = 0 ] )

Find the numeric position of the last occurrence of needle in the haystack string.

http://php.net/manual/en/function.strrpos.php


What you need is strrpos to find the position of the last occurrence of a substring in a string

$string = "Kelley";$strposition = strrpos($string, 'e');var_dump($strposition);


Try this:

strrpos()

Hope that helps.