count_characters[字元計數]

count_characters(計算變數裡的字元數)

test.php:
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Cold Wave Linked to Temperatures.');
$smarty->display('test.html');

#test.html:
{$articleTitle}
{$articleTitle|count_characters}
{$articleTitle|count_characters:true} //空格也計入數字

#輸出:
Cold Wave Linked to Temperatures.
29
33

##################################
繼續學習
||
<?php echo "count_characters(计算变量里的字符数)";