摘要:
function cut_str($sourcestr,$cutlength) {$returnstr=''; $i=0; $n=0; $str_length=strlen($sourcestr);//字符串的字节数 while (($n$cutlength) and ($i=$str_length)) { $temp_str=substr($sourcestr,$i,1); $ascnum=Ord($temp_str);//得到字符串中第$i位字符的ascii码 if ($ascnum=224) //如果ASCII位高与224, { //根据UTF-8编码规范,将3个连续的字符计为单个 阅读全文
posted @ 2010-12-21 11:49
野味@有点甜
阅读(8503)
评论(1)
推荐(0)