count_words This is used to count the number of words in a variable. count_words assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.'); $smarty->display('index.tpl'); ?> ]]> Where index.tpl is: This will output: