count_paragraphs[計算段數]

##count_paragraphs[計算段數]

##test.php:

#$smarty = new Smarty; $smarty->assign('articleTitle', "戰爭使和平的希望黯淡。孩子的死亡毀了
夫婦的假期。\n\n男人被致命殺害。死亡導致孤獨、孤立感。");
$smarty->display('test.html');

##test.html:

{$articleTitle}{$articleTitle|count_paragraphs}

輸出:

戰爭削弱了和平的希望。孩子的死亡毀了夫妻的假期。 男人被致命殺害。死亡會導致孤獨、孤立感。2


#

繼續學習
||
<?php echo "count_paragraphs[计算段数]";
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!