bet亚洲官方网站-bet3365娱乐场手机版

count_sentences

计算变量内容有多少个句子。 每个句子必须以点号、问号或者感叹号结尾。(.?!)

Example 5.6. count_sentences


<?php

$smarty->assign(articleTitle,
                 Two Soviet Ships Collide - One Dies.
                 Enraged Cow Injures Farmer with Axe.
                 );

?>

   

模板是:


{$articleTitle}
{$articleTitle|count_sentences}

   

输出:


Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.
2

   

参见 count_characters, count_paragraphscount_words.

bet亚洲官方网站|bet3365娱乐场手机版

XML 地图 | Sitemap 地图