Home  >  Article  >  Backend Development  >  用mysqli_real_escape_string提交的数据中含有格式,输出数据也是带有格式

用mysqli_real_escape_string提交的数据中含有格式,输出数据也是带有格式

WBOY
WBOYOriginal
2016-06-13 12:07:07933browse

用mysqli_real_escape_string提交的数据中带有格式,输出数据也是带有格式
由于数据进行了验证我用了mysqli_real_escape_string,这样数据在数据库中直接显示如\r\n 这样的格式,我在显示页显示的时候发现数据没有显示该有的样式(换行,加粗,数据一般都是直接复制网上的内容,有的带了格式),而是直接现在下图效果

这是什么情况产生的?
------解决思路----------------------
\r\n 是文本文件的回车换行
而页面是 html 语言,有他自己的换行符


nl2br()

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