一个好用的UTF-8截取字符数的函数
function mSubstr($str, $start, $length=NULL, $etc="...")
{
preg_match_all("/./u", $str, $ar);
if (is_null($length)) {
return join("",array_slice($ar[0], $start));
}else{
return join("",array_slice($ar[0], $start, $length)).
(count($ar[0])>$length?$etc:"");
}
}