smarty @Wiki

count_sentences

最終更新:

匿名ユーザー

- view
だれでも歓迎! 編集

count_sentences

変数内のセンテンスの数をカウントします。

例 5-6. count_sentences

<?php
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.');
$smarty->display('index.tpl');
?>
index.tpl : 
{$articleTitle}
{$articleTitle|count_sentences}
出力: 
Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.
2
ウィキ募集バナー