您现在的位置是:首页 > PHP函数

李清波 2021-06-17 PHP函数 1521 复制当前网址

nl2br



PHP nl2br() 函数

定义和用法

nl2br() 函数在字符串中的每个新行 (\n) 之前插入 HTML 换行符 (<br />)。


语法

nl2br(string)


参数描述
string必需。规定要检查的字符串。


例子

<?php
echo nl2br("One line.\nAnother line.");
?>

输出:

One line.
Another line.

HTML 代码:

One line.<br />
Another line.



文章来源:http://liqingbo.com/blog-830.html

上一篇:number_format

下一篇:nl_langinfo

评论