<?php
/*===================字符串截取中文函数======================*/
function cnsubstr($str,$len)
{
  if(strlen($str)>$len)
  {
    $temp=0;
    for($i=0;$i<$len;$i++)
    {
      if(ord($str[$i])>0xa0) $temp++;
    }
    if($temp%2==0) $str=substr($str,0,$len)."...";
    else $str=substr($str,0,$len+1)."...";
  }
  return $str;
}
print cnsubstr("aaaB是的的发",5);
?>