count_characters
用来计算变量中字符的数量。
例子5-4. count_characters
<?php
$smarty->assign('articleTitle', 'Cold Wave Linked to Temperatures.');
?>
|
模板为:
{$articleTitle}
{$articleTitle|count_characters}
{$articleTitle|count_characters:true} |
输出为:
Cold Wave Linked to Temperatures.
29
33 |
|
参见count_words,count_sentences以及count_paragraphs。