count_sentences[文數(shù)]
count_sent句[計(jì)算數(shù)]
test.php:
$smarty = new Smarty;
$smarty->assign('articleTitle', 'ソ連の船 2 隻が衝突 - 1 隻死亡。激怒した牛が農(nóng)夫を斧で負(fù)傷。');
$smarty->display('test.html');
test.html:
{$articleTitle}
{$articleTitle|count_sentences}
出力:
2 つのソ連船が衝突し、1人が死亡。激怒した牛が農(nóng)夫を斧で負(fù)傷。
2