nl2br[換行符號替換成<br /> ]

nl2br[換行符號替換成<br /> ]

#test.php:
$smarty = new Smarty;
$smarty->assign('articleTitle', "Sun or rain expected\ntoday, dark tonight");
$smarty->display('test.html');

test.html:
{$articleTitle|nl2br}

#輸出:
Sun or rain expected<br />today, dark tonight

繼續學習
||
<?php echo "nl2br[换行符替换成<br /> ]";
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!