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 /> ]";
提交重置代码
  • 推荐课程
  • 评论
  • 问答
  • 笔记
  • 课件下载
课件暂不提供下载,工作人员正在整理中,后期请多关注该课程~