//====================================
//函数功能: 格式化中文字符
//====================================
function chgtitle($title,$length)
{
//$length = 46;
if (strlen($title)>$length) {
$temp = 0;
for($i=0; $i<$length; $i++)
if (ord($title[$i]) > 128)
$temp++;
if ($temp%2 == 0)
$title = substr($title,0,$length)."...";
else
$title = substr($title,0,$length+1)."...";
}
return $title;
} /*
还有另外一个,没有放在我这台计算机上!! 你把筛选出的结果使用这个函数格式化一下,就OK了.
*/
//函数功能: 格式化中文字符
//====================================
function chgtitle($title,$length)
{
//$length = 46;
if (strlen($title)>$length) {
$temp = 0;
for($i=0; $i<$length; $i++)
if (ord($title[$i]) > 128)
$temp++;
if ($temp%2 == 0)
$title = substr($title,0,$length)."...";
else
$title = substr($title,0,$length+1)."...";
}
return $title;
} /*
还有另外一个,没有放在我这台计算机上!! 你把筛选出的结果使用这个函数格式化一下,就OK了.
*/
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货