How to solve the line feed in textarea? How to solve the line feed problem in textarea? This is not especially true if you want to use the editor. because the text is submitted by user input, you can only wrap the text in textarea from the security perspective. In addition, if you cannot solve the problem by using the editor, the front-end will have sent all the user self-input posts to htmlentities. So how are the labels implemented? How can I solve the problem of text wrapping in textarea?
How to solve the line feed problem in textarea?
This is not especially true if you want to use the editor. because the text is submitted by user input, you can only wrap the text in textarea from the security perspective.
In addition, if you cannot solve the problem by using the editor, the front-end will have sent all the user self-input posts to htmlentities. So how are the labels implemented?
Ask experienced experts for a solution ..
------ Solution --------------------
Replace \ n \ r
------ Solution --------------------
$ Content = "test \ nxxx \ ntest \ n ";
$ Content = nl2br ($ content );
Echo $ content;
------ Solution --------------------
Convert $ _ POST ['content'] to htmlspecialchars:
$ New = htmlspecialchars ("Test", ENT_QUOTES );
Echo $ new; // <a href = 'test'> test </a>