--- Array (2)
0 => Array (2)
  page_nm => "トップ"
  page_sysnm => "top"
1 => Array (3)
  page_nm => "Smartyマニュアル"
  page_sysnm => "manual_smarty"
  this => 1 ---

count_characters

count_characters

変数内の文字数をカウントします。

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

例 5-4. count_characters

<?php

$smarty
->assign('articleTitle''Cold Wave Linked to Temperatures.');

?>

テンプレート

{$articleTitle}
{$articleTitle|count_characters}
{$articleTitle|count_characters:true}

出力

Cold Wave Linked to Temperatures.
29
33

count_wordscount_sentences および count_paragraphs も参照してください。