mb_strrichr
(PHP 5 >= 5.2.0, PHP 7, PHP 8)
Finds the last occurrence of a character in a string within another, case insensitive
Description
mb_strrichr() finds the last occurrence of needle in haystack and returns the portion of haystack. Unlike mb_strrchr(), mb_strrichr() is case-insensitive. If needle is not found, it returns false.
Parameters
haystackThe string from which to get the last occurrence of
needle.needleThe string to find in
haystack.before_needleDetermines which portion of
haystackthis function returns. If set to true, it returns all ofhaystackfrom the beginning to the last occurrence ofneedle. If set to false, it returns all ofhaystackfrom the last occurrence ofneedleto the end.encodingParameter
Return Values
Returns the portion of haystack. or false if needle is not found.
Changelog
| Version | Description |
|---|