mb_eregi
Multi-byte supports regular expression matching and ignore case
Function name: mb_eregi()
Applicable version: PHP 4 >= 4.2.0, PHP 5, PHP 7
Usage: The mb_eregi() function performs case-insensitive regular expression matching. Similar to the mb_ereg() function, but is case-insensitive.
Syntax: int mb_eregi(string $pattern, string $string [, array &$regs])
parameter:
Return value: Return a non-zero integer if the match is successful, otherwise return 0.
Example:
$str = "Hello, World!"; if (mb_eregi("hello", $str)) { echo "匹配成功!"; } else { echo "匹配失败!"; } // 输出:匹配成功!
In the above example, the mb_eregi() function uses the regular expression pattern "hello" to match in the string "$str". Since it is case-insensitive, the match is successful and the output is "Match Success!".