How do I echo line breaks from a MySQL database?

前端 未结 2 1083
失恋的感觉
失恋的感觉 2021-01-24 05:55

I have created a simple wall post feature, like on FaceBook.

A user writes a post, the post is submitted to the database and then echoed back onto the website; that all

2条回答
  •  不思量自难忘°
    2021-01-24 06:19

    PHP function nl2br converts newlines to "
    " breaks.
    So, $wallpost=nl2br($wallpost); should accomplish the task.

提交回复
热议问题