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); Link to comment https://forums.phpfreaks.com/topic/165859-solved-annoying-extra-line-break/ 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); Link to comment https://forums.phpfreaks.com/topic/165859-solved-annoying-extra-line-break/#findComment-874868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.