nl2br[개행 문자를 &l...로그인

nl2br[개행 문자를 <br />로 교체]

nl2br[换行符替换成<br /> ]

test.php:
$smarty = new Smarty;
$smarty->ass('articleTitle', "오늘은 해나 비 예상, 오늘 밤은 어두움");
$smarty->display(' test.html');

test.html:
{$articleTitle|nl2br}

输출:
오늘은 해나 비 예상됨<br />오늘 밤은 어두움

<?php echo "nl2br[换行符替换成<br /> ]";
코스웨어