Home > Backend Development > PHP Tutorial > 关于textarea 中处理回车的有关问题

关于textarea 中处理回车的有关问题

WBOY
Release: 2016-06-13 10:21:08
Original
812 people have browsed it

关于textarea 中处理回车的问题
$message = nl2br($POST['message']);
然后存入数据库的
但是用户在编辑内容的时候,编辑框是textarea 这个时候显示的就是:
abc

def

怎么样能让用户编辑的时候,textarea 中显示:
abc
def

编辑框我是这样显示的:

------解决方案--------------------


换为"\n"

一般建议,原字符串入库,,网页呈现的时候,才nl2br

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template