Code segment: when inserting text data into mysql, the front-end with a format does not need an editor, and only uses the & lt; textarea & gt; format to insert a text with a format to MYSQL. In the future, formatted text will be displayed at the front end. Solution: ------------------ first, I want to explain that the concept of segmentation does not exist in textarea; unless you use the UBB text editor;
Front-end editor is not required, only Insert formatted text to MYSQL.
In the future, formatted text will be displayed on the front-end.
------ Solution --------------------
First, I want to explain that the concept of segmentation does not exist in textarea;
Unless you use the UBB text editor;
Second, in textarea, only line breaks, other bold, font, size, color, labels, and so on will not have any effect;
Therefore, in textarea, only the line feed mode can be retained;
Php processes line breaks;
Stored in the database:
$ Content = str_replace ("
", Chr (10), $ content); // chr (10) line break ascii code
Input is edited in textarea;
$ Content = str_replace ("\ n ","
", $ Content );