count_words修飾子 単語の数を数える

変数内の単語の数を数える。

PHP

$smarty->assign('hoge', "it is fine today");

テンプレート

{$hoge}
{$hoge|count_words}

出力

it is fine today
4

関連記事

スポンサーリンク

北海道の電車路線、駅の一覧

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る