Home  >  Article  >  Backend Development  >  textarea的换行符是什么解决方法

textarea的换行符是什么解决方法

WBOY
WBOYOriginal
2016-06-13 10:09:12823browse

textarea的换行符是什么
我想通过换行符explode拆分成多行数组
网上说是\r\n,但我试了不行

------解决方案--------------------
尝试下,输出的时候替换下

PHP code
$content= str_replace("<br>","\r\n",$content);<br><font color="#e78608">------解决方案--------------------</font><br>$content= str_replace("<br>","\r\n",$content);<br><font color="#e78608">------解决方案--------------------</font><br>查查资料 这都是基础性的东西  琢磨琢磨就出来了<br><font color="#e78608">------解决方案--------------------</font><br>
探讨
我想通过换行符explode拆分成多行数组
网上说是\r\n,但我试了不行

------解决方案--------------------
探讨

尝试下,输出的时候替换下
PHP code
$content= str_replace("
","\r\n",$content);

------解决方案--------------------
有时候是一个的。看看真实的情况。
------解决方案--------------------
定一下~!
------解决方案--------------------
可以是
\r\n
\n
\r
之一,随操作系统而定

使用时需放在双引号中方可生效
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn