php - preg_split('/(?
迷茫
迷茫 2017-04-11 09:59:02
0
1
418
function mb_str_split( $string ) { # Split at all position not after the start: ^ # and not before the end: $ return preg_split('/(?

$string = '火车票';
$charlist = mb_str_split( $string );

print_r( $charlist );
?>

Prints:

Array
(

[0] => 火 [1] => 车 [2] => 票

)


是PHP手册里面的一个例子,其实已经有注释了。 自己知道要区分多字节正则表达式需要加上 u 修饰符, 但是对里面的正则代表的含义不是太懂,(?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all (1)
洪涛

是环视,匹配位置的用法~

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!