<?php
//字符串转成字符数组(包含汉字)
function mbStrSplit ($string, $len=1) {
$start = 0;
$strlen = mb_strlen($string);
while ($strlen) {
$array[] = mb_substr($string,$start,$len,"utf8");
$string = mb_substr($string, $len, $strlen,"utf8");
$strlen = mb_strlen($string);
}
return $array;
}
$astr = "ab你好c8?=-9898d";
$out = mbStrSplit($astr);
var_dump($out);die;
?>
网友评论