The example in this article describes the solution to the problem of many spaces when php submits textarea data to mysql. Share it with everyone for your reference. The specific analysis is as follows:
Some friends may find that after we submit the html to php for processing and save the data to mysql, we will find that there will be a lot of spaces when we read the data from mysql again. Then if we view it directly in mysql, there will be no space. , what is this problem and how to deal with it.
Solution to the problem that there are always a lot of spaces in textarea
Problem description:
When reading mysql data into textarea in php, there are always many spaces at the beginning and end. When viewing the data in the data table, there are no spaces.
Cause of the problem:
The content should be written against the textarea, and there should be no spaces or line breaks after the textarea.
Solution:
The code is as follows:
Supplement:
The newline character in php textarea is "rn"
Not 'n'
Not "
"
Not 'rn'
Not 'r'+'n'
I hope this article will be helpful to everyone’s PHP programming design.