nonexistentera Posted June 18, 2009 Share Posted June 18, 2009 Is there a way to do this. Like if the original string was Great job. Amazing and went through nl2br to become Great job. <br /> Amazing is there anyway to revert back to the original formatting. I guess what Im asking is if there is a way to go from <br /> to \n and showing the string in it's original form of Great job. Amazing I was thinking of preg_match or something along the lines of that. Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted June 18, 2009 Share Posted June 18, 2009 str_replace('<br />',"\n",$str); Quote Link to comment Share on other sites More sharing options...
akitchin Posted June 18, 2009 Share Posted June 18, 2009 str_replace('<br />',"\n",$str); that's actually going to leave you with double line-breaks, since nl2br() adds an end-of-line with each <br /> tag. 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.