其他分享
首页 > 其他分享> > dedecms统计文章内容字数及大小

dedecms统计文章内容字数及大小

作者:互联网

dedecms统计文章内容字数及大小,代码如下:

// 统计文章字数及大小 https://www.360muye.cn
{dede:field.body runphp="yes"} @me = html2text(@me); $strlen = ceil(mb_strwidth(@me)/3); $kb = ceil(strlen(@me)/1024); $read_time = ceil($strlen/400); $results .= "本文有{$strlen}个文字,"; $results .= "大小约为{$kb}KB,"; $results .= "预计阅读时间{$read_time}分钟。"; @me = $results; {/dede:field.body}

通过上面可以统计文章字数、大小及预计阅读时间,转载请注明:鹏程木业网

标签:me,results,ceil,dedecms,文章内容,字数,大小,strlen
来源: https://www.cnblogs.com/fymuban/p/14750761.html