字符串截取的时候
没有处理好
function sub_str($string,$strlen,$other=true)
{
for($i=0;$i<$strlen;$i++)
{
if(ord(substr($string,$i,1))>0xa0)
{
$j++;
}
if($j%2!=0)
{
$strlen++;
}
$rstr = substr($string,0,$strlen);
if (strlen($string)>$strlen && $other)
{
$rstr .='...';
}
}
return $rstr;
}
没有处理好
function sub_str($string,$strlen,$other=true)
{
for($i=0;$i<$strlen;$i++)
{
if(ord(substr($string,$i,1))>0xa0)
{
$j++;
}
if($j%2!=0)
{
$strlen++;
}
$rstr = substr($string,0,$strlen);
if (strlen($string)>$strlen && $other)
{
$rstr .='...';
}
}
return $rstr;
}
有些WIN98 IE5只要遇到全角空格就显示一个“?”,但是在XP下正常。