mb_stripos
Case insensitively find where a string first appears in another string
Function name: mb_stripos()
Applicable version: PHP 4 >= 4.2.0, PHP 5, PHP 7
Function Description: The mb_stripos() function looks for another string (case insensitive). Similar to the stripos() function, but mb_stripos() supports multibyte characters.
Syntax: mb_stripos(string $haystack, string $needle, int $offset = 0, string $encoding = mb_internal_encoding()): int|false
parameter:
Return value:
Example:
$haystack = "Hello, World!"; $needle = "world"; $position = mb_stripos($haystack, $needle); if ($position !== false) { echo "找到子字符串,位置为:" . $position; } else { echo "未找到子字符串"; }
Output:
找到子字符串,位置为:7
Notes: