count_sentences[計算句數]

##count_sentences[計算句數]

test.php:#$smarty = new Smarty;
$smarty->assign('articleTitle', '兩艘蘇聯船相撞- 其中一艘死亡。憤怒的牛用斧頭傷害了農民。');
$smarty->display('test.html' );


test.html:##{$articleTitle}{$articleTitle|count_sentences}


#輸出:
兩個蘇聯船舶相撞──一人死亡。憤怒的牛用斧頭砍傷了農夫。2

#

繼續學習
||
<?php echo "count_sentences[计算句数]";