php中文汉字字符转数组
程序员文章站
2024-02-01 19:27:46
1 //汉字字符转数组 2 function chStrToArray($str){ 3 $length = mb_strlen($str, 'utf-8'); 4 $array = array(); 5 for ($i=0; $i<$length; $i++) 6 $array[] = mb_su... ......
1 //汉字字符转数组 2 function chstrtoarray($str){ 3 $length = mb_strlen($str, 'utf-8'); 4 $array = array(); 5 for ($i=0; $i<$length; $i++) 6 $array[] = mb_substr($str, $i, 1, 'utf-8'); 7 return $array; 8 }