count_words[計算詞數]

##count_words[計算詞數]

test.php:#$smarty = new Smarty;
$smarty->assign('articleTitle', '經銷商中午會聽到汽車談話聲。');
$smarty->display('test.html');


test.html:{$articleTitle}
{$articleTitle|count_words}


#輸出:##經銷商中午會聽到汽車談話。 7

##

繼續學習
||
<?php echo "count_words[计算词数]";