从MySQL数据库回显空格和换行符? [英] Echo from MySQL database with spaces and line breaks?
本文介绍了从MySQL数据库回显空格和换行符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我注意到,当我在VARCHAR中向MySQL表单提交文本时,它确实存储了换行符. (因为它们显示在PHPMyAdmin中).但是,当我回显Text列时,我将所有内容都显示在一行中.
如何回显保留换行符的值?
解决方案
nl2br()
>
I noticed that when I submit text to my MySQL form in VARCHAR it does store line breaks. (Since they show in PHPMyAdmin). However when I echo column Text, I get everything in a single line.
How can I echo values retaining line breaks?
解决方案
这篇关于从MySQL数据库回显空格和换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文