count_sentences[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

Continuing Learning
||
<?php echo "count_sentences[计算句数]";
submitReset Code