duangua6912 2008-11-14 03:29
浏览 124
已采纳

捕获textarea中的换行符(换行符,换行符)

I have a form with a <textarea> and I want to capture any line breaks in that textarea on the server-side, and replace them with a <br/>.

Is that possible?

I tried setting white-space:pre on the textarea's CSS, but it's still not enough.

  • 写回答

4条回答 默认 最新

  • dongxieli3839 2008-11-14 03:35
    关注

    Have a look at the nl2br() function. It should do exactly what you want.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?