切割中文字符

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;
}
$woed =mbStrSplit($k);

posted @ 2016-04-27 14:10  快乐~  阅读(262)  评论(0编辑  收藏  举报