strrpos()
strrpos - Find position of last occurrence of a char in a string
Syntax
int strrpos (
string $haystack,
string $needle,
int $offset)
Arguments
- haystack - The string to search in.
- needle - If needle is not a string, it is converted to an integer and applied as the ordinal value of a character.
- 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.
Description
Returns the numeric position of the last occurrence of needle in the haystack string. Note that the needle in this case can only be a single character in PHP 4. If a string is passed as the needle, then only the first character of that string will be used.
Version
PHP 4, 5
Return value
Returns the position where the needle exists. Returns FALSE if the needle was not found.