TeroYukio Posted July 22, 2010 Share Posted July 22, 2010 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? Link to comment https://forums.phpfreaks.com/topic/208588-rnrn-coming-into-form-where-i-put-an-enter-in-the-code/ Share on other sites More sharing options...
DavidAM Posted July 22, 2010 Share Posted July 22, 2010 $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); Link to comment https://forums.phpfreaks.com/topic/208588-rnrn-coming-into-form-where-i-put-an-enter-in-the-code/#findComment-1089812 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.