mysql显示回车但nl2br不维护它们

时间:2012-07-22 05:44:05

标签: php mysql nl2br

我在MySQL数据库中有文本字段,在PHPMyAdmin中显示为包含换行符或回车符。但是,当在网页上显示该文本字段时,它们不在那里。

我试过nl2br()。我在\ n \ r \ n \ r \ n&上尝试过str_replace \诉一切都没有运气。

原始数据来自Filemaker数据库。我无法弄清楚什么是回程。

有什么想法吗?

更新 这是来自数据库字段的样本的直接复制和粘贴,但据我所知,它不会过渡到此注释字段100%相同。但是这里有:

2010 Telecommunications - technical/internal brochure2004 Foodtown Catalogue and Banner2001 Alliance Group Holdings Annual Report2001 Cover of Company Profile2000 Clear Communications Mailout

在数据库的文本字段中,它显示如下:

2010 Telecommunications - technical/internal brochure
2004 Foodtown Catalogue and Banner
2001 Alliance Group Holdings Annual Report
2001 Cover of Company Profile

1 个答案:

答案 0 :(得分:0)

使用

nl2br(htmlspecialchars($text));