This is used to count the number of characters in a variable.计算变量里的字符数
Example 5-3. count_characters
index.php: $smarty = new Smarty; $smarty->assign('articleTitle', 'Cold Wave Linked to Temperatures.'); $smarty->display('index.tpl'); index.tpl: {$articleTitle} {$articleTitle|count_characters} {$articleTitle|count_characters:true} OUTPUT输出: Cold Wave Linked to Temperatures. 29 33