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}
通过上面可以统计文章字数、大小及预计阅读时间,转载请注明:鹏程木业网
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号