织梦php汉字字符串中间插入换行符方法
织梦php汉字字符串中间插入换行符实现函数方法:
function strsub($str) { $str_count=mb_strlen($str,'utf-8'); $mid=ceil($str_count/2); return mb_substr($str,0,$mid,'utf-8')."<br/>".mb_substr($str,$mid,$str_count,'utf-8'); } |
织梦php汉字字符串中间插入换行符实现函数方法:
function strsub($str) { $str_count=mb_strlen($str,'utf-8'); $mid=ceil($str_count/2); return mb_substr($str,0,$mid,'utf-8')."<br/>".mb_substr($str,$mid,$str_count,'utf-8'); } |