Jump to content

Newlines in textarea


Recommended Posts

This is a strange problem.. I'm saving data into the DB from a textarea (example: "this is a

new line!"). The data has newlines in it (\n or \r\n). In the DB, the newlines are shown on separate lines, but when I load the data from the DB into the textarea, everything is on one line! What's going on there?

 

I did a quick search on google, and people keep bringing up the nl2br function.. that isn't what I need ;) That makes the data look like "this is a<br />new line!"

 

So the newlines ARE THERE! They just don't show in my textareas.. why so?

 

Wes

Link to comment
https://forums.phpfreaks.com/topic/162712-newlines-in-textarea/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.