我使用引号将列条目括起来,成功将换行符插入我的sqlite数据库中:
"start
end"
但是当我在php中查询时,所有的换行符都消失了!
start end
我该如何保留换行符?
nl2br
nl2br的PHP文档说明如下:
nl2br — 在字符串中所有换行符前插入HTML换行标签
以下是一个示例:
只需要在您的echo后添加nl2br:Example #1 Using nl2br()
<?php echo nl2br("foo isn't\n bar"); ?>
The above example will output:
foo isn't<br /> bar
echo nl2br(.....);