![]() |
The mb_strrichr() function is a case-insensitive in-built function. This function searches a multi-byte string for the last occurrence of a specified character and returns the portion of the string. Syntax: mb_strrichr( $haystack, $needle, $before_needle , $encoding) : string|false
Parameters: This function accepts 4 parameters that are described below.
Return Values: The mb_strrichr() function returns the portion of the string that follows or precedes the last occurrence of the specified character or substring, depending on the value of the $before_needle parameter. If the character or substring is not found, the function returns “false”. Example 1: The following program demonstrates the mb_strrichr() function. PHP
Output
, world! Example 2: The following program demonstrates the mb_strrichr() function. PHP
Output
The last occurrence of 'o' in the haystack is: orld! Reference: https://www.php.net/manual/en/function.mb-strrichr.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 15 |