PHP7中文手册2018 带注释 最新chm版
header("Content-type:text/html;charset=utf-8");
$str="赵钱孙";
function mbstringToArray($str,$charset) {
$strlen=mb_strlen($str);
while($strlen){
$array[]=mb_substr($str,0,1,$charset);
$str=mb_substr($str,1,$strlen,$charset);
$strlen=mb_strlen($str);
}
return $array;
}
//用法gbk utf-8
$arr = mbstringToArray($str,"utf-8");
var_dump($arr);
转载请注明:谷谷点程序 » str_split汉字分割替换函数