javascript - Using thinkphp3.2.3, the textarea has been manually entered and the line feed is entered, but after submission, the database does not have any line feed tags. How to solve it?
PHP中文网
2017-05-16 13:15:21
Using thinkphp3.2.3, the textarea has been manually entered and newlined, but after submission, the database does not have any newline tags. How to solve it?
Add <pre>
when the page is displayedAs shown in the picture
Convert the newline character to <br> and then store it in the database
The space (r) and newline character (n) in the textarea do not display labels in the database. You can use them when displaying the page
But if a line of content is too long, it will not automatically wrap. You can also convert the textarea's line wrapping to
when displaying.In this way, the output content will have line breaks.