About the carriage return handling problem in textarea $ message = nl2br ($ POST ['message']); then stored in the database, but when the user edits the content, the edit box is textarea. when abc & lt; br/& gt; def is used to edit the file, the following figure is displayed in textarea: in the abcdef edit box, I have a question about how to handle carriage return in textarea.
$ Message = nl2br ($ POST ['message']);
And then save it to the database
However, when you edit the content, the edit box is textarea, which is displayed as follows:
Abc
Def
How can I display the following information in textarea when editing a user:
Abc
Def
The edit box is displayed as follows: $ Blog [message]
------ Solution --------------------
For \ n"
Generally, it is recommended that the original string be stored in the database. the nl2br is used only when the webpage is displayed.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service