count_characters修飾子 文字数を数える

変数内の文字数を数える。

パラメータの位置必須デフォルト概要
1booleanNoFALSE空白文字をカウントに含めるかどうか

PHP

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

テンプレート

{$hoge}
{$hoge|count_characters}
{$hoge|count_characters:true}

出力

it is fine today.
14
17

関連記事

スポンサーリンク

padding-top 上パディングを指定する

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

上に戻る