摘要: function chgtitle($title){$length=20;$encoding='gb2312';if(mb_strlen($title,$encoding)>$length){$title=mb_substr($title,0,$length,$encoding).'...';}return $title;}echo chgtitle("请您选择正确的分类,以使您的问题尽快得到解答");//-------------------这里使用到了mbstring函数库,这个函数库可以根据设置的编码自动计算并截取字符串,不会出现 阅读全文
posted @ 2012-02-25 15:38 象牛 阅读(215) 评论(0) 推荐(0) 编辑