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? Quote 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); Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.