|
strrposFind the position of the last occurrence of a substring in a string Description
intfalse strrpos(string
$haystack , string $needle , int $offset = 0)
Find the numeric position of the last occurrence of
Parameters
Return Values
Returns the position where the needle exists relative to the beginning of
the
Returns Warning
This function may
return Boolean Changelog
Examples
Example #1 Checking if a needle is in the haystack It is easy to mistake the return values for "character found at position 0" and "character not found". Here's how to detect the difference:
Example #2 Searching with offsets
The above example will output: int(0) bool(false) int(27) bool(false) int(17) bool(false) int(29) See Also
|