Preserve Line Breaks From TextArea When Writing To MySQL

前端 未结 7 2204
我在风中等你
我在风中等你 2020-11-22 12:25

I\'m using a textarea to enable users to input comments. However, if the users enters new lines, the new lines don\'t appear when they are outputted. Is there any way to m

7条回答
  •  心在旅途
    2020-11-22 12:58

    function breakit($t) {
        return nl2br(htmlentities($t, ENT_QUOTES, 'UTF-8'));
    }
    

    this may help you

    pass the textarea wal

提交回复
热议问题