求助~~关于显示自定义长度字符串的问题
我写了一个自定义字符串长度的函数,代码如下:
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->function _word_num($string,$length){ $string = trim($string); if(strlen($string)>$length){ return (mb_substr($string,0,$length,"gbk")."..."); }else { return $string; } }