![]() |
The mb_stristr() is an inbuilt function in PHP that is used to get the first occurrence of a string within another string. It will check case insensitivity. Syntax:mb_stristr( $haystack, $needle, $before_needle, $encoding = null ): string|false Parameters:This function accepts 4 parameters that are described below:
Return Value:This function returns the portion of $haystack if the needle is found in a $haystack, otherwise, it will return “false”. Program 1: The following program demonstrates the mb_stristr() Function. PHP
Output
World Program 2: The following program demonstrates the mb_stristr() Function. PHP
Output
bool(false) Program 3: The following program demonstrates the mb_stristr() Function. PHP
Output
Substring 'WORLD' found in 'Hello World' Reference: https://www.php.net/manual/en/function.mb-stristr.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 11 |