nl2br() 函数在字符串中的每个新行 (n) 之前插入 html 换行符 (<br />)。
语法
nl2br(string)参数 描述
string 必需。规定要检查的字符串。
例子
复制代码 代码如下:
<?php
echo nl2br("one line.nanother line.");
?>
输出:
one line.
another line.html 代码:
one line.<br />
another line.
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!