strpos and strrpos
strpos()
This function is used to find the first occurrence of the given string.
strpos()
This function is used to find the last occurrence of the given string.
Example:
$string = “mystrstr”;
echo $pos = strpos($string, “str”);
echo $pos = strrpos($string, “str”);
In the above example first echo will return 2 and the second echo will return 5.
