2012-04-19 49 views

回答

0

简单得到摘录并发布单词/字符长度。 假设

if ($post_l > $excerpt_l) 
{ 
//show read more 
} 
else 
{ 
//shoe post without read more 
} 

PHP字数

function count_words($str) 
{ 
$no = count(explode(" ",$str)); 
return $no; 
}