I have a form that includes a text area. When I insert the value of the text area into MS SQL, it places \r\n etc wherever the user wanted a new line or paragraph.
So for example, in the form, my text looks like this:
test
testtest
test
in the column in SQL Server, my inserted value looks like:
test\r\n\r\ntesttest\r\n\r\ntest
etc
I need this to insert into SQL server, without those values (basically, I just want to insert exactly as it looks on the textfield when the user fills it in). In MySQL, I have no problem with this since it seems to insert normally (although I think PHPMyAdmin might format those fields with nl2br() automatically, not sure about that). Then, when I display these from a SELECT on my site, I need to be able to use the nl2br() function normally so that the text gets formatted for display.
I tried using a couple different forms of preg_replace(), but can't seem to get that right, not does str_replace() seem to do what I want.
I've searched and searched for something on this, and can't seem to get what I'm looking for.
Any thoughts would be much appreciated.