nl2br[换行符替换成<... 登录

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 /> ]";
提交 重置代码
章节 评论 笔记 课件
  • 取消 回复 发送
  • 取消 发布笔记 发送