str_split 中文问号问题, mb_split() 分解词组

用以下函数来代替str_split

function mbStringToArray ($string) {
    $strlen = mb_strlen($string);
    while ($strlen) {
        $array[] = mb_substr($string,0,1,"utf8");
        $string = mb_substr($string,1,$strlen,"utf8");
        $strlen = mb_strlen($string);
    }
    return $array;
}
print_r(mbStringToArray('我,的电,脑COM'));

 

要引用mbstring.dll这个扩展

你可能感兴趣的:(split)