相关疑难解决方法(0)

在HTML中显示mysql换行符

我们的mysql数据库中的某些字段似乎包含换行符,因此如果我对它们进行SELECT,则会为单个SQL调用返回类似以下内容:

Life to be sure is nothing much to lose

But young men think it is and we were young
Run Code Online (Sandbox Code Playgroud)

如果我想在网页上显示此字段时保留换行符,那么编写脚本以使用br HTML标记替换'\n\r'的标准解决方案还是有更好的方法?

谢谢!

html mysql newline line-breaks

2
推荐指数
1
解决办法
6865
查看次数

标签 统计

html ×1

line-breaks ×1

mysql ×1

newline ×1