我们的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'的标准解决方案还是有更好的方法?
谢谢!