mb_split
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
mb_split — 使用正则表达式分割多字节字符串
说明
mb_split
( string
$pattern
, string $string
, int $limit
= -1
) : array
使用正则表达式 pattern
分割多字节 string
并返回结果 array。
参数
-
pattern
-
正则表达式。
-
string
-
待分割的 string。
-
limit
-
如果指定了可选参数
limit
,将最多分割为limit
个元素。
返回值
array 的结果。
注释
注意:
The character encoding specified by mb_regex_encoding() will be used as the character encoding for this function by default.
参见
- mb_regex_encoding() - Set/Get character encoding for multibyte regex
- mb_ereg() - Regular expression match with multibyte support