Preserve Line Breaks From TextArea When Writing To MySQL

前端 未结 7 2121
我在风中等你
我在风中等你 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 13:05

    i am using this two method steps for preserve same text which is in textarea to store in mysql and at a getting time i can also simply displaying plain text.....

    step 1:

    $status=$_POST['status'];<br/>
    $textToStore = nl2br(htmlentities($status, ENT_QUOTES, 'UTF-8'));
    

    In query enter $textToStore....

    step 2:

    write code for select query...and direct echo values....

    It works

    0 讨论(0)
提交回复
热议问题