shadiadiph Posted July 13, 2009 Share Posted July 13, 2009 hi i have been trying to $_GET a message string which has to be formatted nl2br inorder for it to keep its format but when i display it for the second time it keeps displaying as if it has an extra line break between each line break can any one think of a fix for this thanks. $message = $_GET["mesid"]; $message = rawurldecode($message); $message = stripslashes($message); $message = preg_replace('/<br( )?(\/)?>/i', "\n", $message); Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted July 13, 2009 Author Share Posted July 13, 2009 its ok i got it sorry i just couldn't see it but this reverses nl2br perfectly $message = $_GET["mesid"]; $message = rawurldecode($message); $message = stripslashes($message); $message = preg_replace('/<br( )?(\/)?>/i', "", $message); Quote Link to comment 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.