count_sentences[计算句数]

count_sentences[计算句数]

test.php:
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.');
$smarty->display('test.html');

test.html:
{$articleTitle}
{$articleTitle|count_sentences}

输出:
Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.
2

继续学习
||
<?php echo "count_sentences[计算句数]";
提交重置代码
  • 推荐课程
  • 评论
  • 问答
  • 笔记
  • 课件下载
课件暂不提供下载,工作人员正在整理中,后期请多关注该课程~