时间:2021-07-01 10:21:17 帮助过:24人阅读
/** * Convert a string to an array * @param string $str * @param number $split_length * @return multitype:string */ function mb_str_split($str,$split_length=1,$charset="UTF-8"){ if(func_num_args()==1){ return preg_split('/(?方法二:
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; }以上所述就是本文的全部内容了,希望大家能够喜欢。