Jump to content

rnrn coming into form where I put an "enter" in the code.


TeroYukio

Recommended Posts

I have this code that inserts

$_POST['description']

into a database however this is a

<textarea>

and in the text area I put in "enters" like you would do with BBC.  Of course I use

<br>

to create a new line, but I put an "enter" in the box just for neatness sake but when I insert it into the data base "rn" goes in place of every "enter" i put in.  Is there something like

stripslashes($variable)

I could use to stop the "rn"s from showing up?

$clearString = str_replace("\r\n", "", $badString);

 

although, I would probably replace them individually. That way if the CR is not there, the NL is still replaced:

 

$clearString = str_replace(array("\r", "\n"), "", $badString);

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.