国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

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中文網(wǎng)
PHP中文網(wǎng) 2017-05-16 13:15:21
0
3
781

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?

PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證0級講師

reply all(3)
某草草

Add <pre>

when the page is displayed
<pre>{$content}</pre>

As shown in the picture

世界只因有你
nl2br($str);

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

<pre>{$content}</pre>

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.
str_replace("\n", "<br>", $content4);

In this way, the output content will have line breaks.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template