count_sentences修飾子 センテンス(文)の数を数える

変数内のセンテンス(文)の数を数える。

PHP

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

テンプレート

{$hoge}
{$hoge|count_sentences}

出力

it is fine today - Good morning!
2

関連記事

スポンサーリンク

php.ini [PHP設定ファイル]のデフォルト

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

上に戻る