开发者

How to use linebreaks in a textbox?

开发者 https://www.devze.com 2022-12-17 20:56 出处:网络
I am saving text from a textarea in the database and display it in another textarea. The linebreaks are displayed as \\n which should be right, but the textarea is displaying

I am saving text from a textarea in the database and display it in another textarea. The linebreaks are displayed as \n which should be right, but the textarea is displaying them instead of do开发者_Go百科ing the breaks! How can I fix this?


You need to send a literal line break, not an escape sequence.


Thank you David,

this worked...

str_replace('\n', "
", $text);

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号