smarty @Wiki

count_words

最終更新:

匿名ユーザー

- view
だれでも歓迎! 編集

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
ウィキ募集バナー