strrpos
(PHP 4, PHP 5)
strrpos — Find position of last occurrence of a char in a string
Description
int strrpos
( string $haystack
, string $needle
[, int $offset
] )
If needle
is not found, returns FALSE.
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:
If needle
is not a string, it is converted
to an integer and applied as the ordinal value of a character.
Note:
As of PHP 5.0.0 offset
may
be specified to begin searching an arbitrary number of characters into
the string. Negative values will stop searching at an arbitrary point
prior to the end of the string.
Note:
The needle
may be a string of more than one
character as of PHP 5.0.0.
Parameters
-
haystack
-
-
needle
-
-
offset
-