//uc转码开始修复

//转THML进制编码
function UnicodeEncode($str){
    //split word
    preg_match_all('/./u',$str,$matches);
 
    $unicodeStr = "";
    foreach($matches[0] as $m){
        //拼接
        $unicodeStr .= "&#".base_convert(bin2hex(iconv('UTF-8',"UCS-4",$m)),16,10);
    }
    return $unicodeStr;
}
//切割中文字符串
function mb_str_split($str,$split_length=1,$charset="UTF-8"){
  if(func_num_args()==1){
    return preg_split('/(?<!^)(?!$)/u', $str);
  }
  if($split_length<1)return false;
  $len = mb_strlen($str, $charset);
  $arr = array();
  for($i=0;$i<$len;$i+=$split_length){
    $s = mb_substr($str, $i, $split_length, $charset);
    $arr[] = $s;
  }
  return $arr;
}

$rico_content = mb_str_split($rico_content);
$rico_content_str = '';
foreach ($rico_content as $rico_content){
    $rico_content_str .= '<i>'.UnicodeEncode($rico_content).'</i>';
}
$rico_content = $rico_content_str;
$rico_content = str_replace('<i>&#60</i><i>&#98</i><i>&#114</i><i>&#62</i>','<br>',$rico_content);

//UC转码修复结束

发表评论

邮箱地址不会被公开。 必填项已用*标注