count_words
変数内の単語の数をカウントします。
例 5-7. count_words
<?php
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
$smarty->display('index.tpl');
?>
index.tpl :
{$articleTitle}
{$articleTitle|count_words}
Dealers Will Hear Car Talk at Noon.
7
例 5-7. count_words
<?php
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.');
$smarty->display('index.tpl');
?>
index.tpl :
{$articleTitle}
{$articleTitle|count_words}
出力 :
Dealers Will Hear Car Talk at Noon.
7
2005年07月08日(金) 10:44:26 Modified by smarten