count_words
统计变量中单词的数量。
例子5-7. count_words
<?php
$smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
?>
|
模板为:
{$articleTitle}
{$articleTitle|count_words} |
输出为:
Dealers Will Hear Car Talk at Noon.
7 |
|
参见count_characters,count_paragraphs以及count_sentences。