count_sentences[计算句数]
count_sentences[计算句数]
test.php:
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.');
$smarty->display('test.html');
test.html:
{$articleTitle}
{$articleTitle|count_sentences}
输出:
Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.
2