PHP的nl2br
1.簡述
nl to br? 意思是 \n編程<br>
nl2br() 函數(shù)在字符串中的每個(gè)新行(\n)之前插入 HTML 換行符(<br> 或 <br />)。
2.代碼
echo nl2br("One line.\nAnother line.",false);One line. Another line.3.補(bǔ)充br2nl
function br2nl($text) { return preg_replace('/<br\\s*?\/??>/i', '', $text); } function br2nl(txt) { var re = /(<br\/>|<br>|<BR>|<BR\/>)/g; var s = txt.replace(re, "\n"); return s; }?
總結(jié)
- 上一篇: 个人征信查询方法有哪些
- 下一篇: PHP的microtime