2012-04-19 48 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; 
}