fife Posted February 24, 2011 Share Posted February 24, 2011 I have a field in my database called `intro` In this field the user has entered spaces, different paragraphs and "" When it was entered into the field it was run through trim and mysql_real_escape_string. when its echoed I am just using echo "member['intro']; How do I make it display like it was entered? Is there a function for this? Quote Link to comment https://forums.phpfreaks.com/topic/228732-echo-spaces-and/ Share on other sites More sharing options...
fife Posted February 24, 2011 Author Share Posted February 24, 2011 sorry. I have found the answer after lot of searching str_replace("\n", "\n<br />\n" Quote Link to comment https://forums.phpfreaks.com/topic/228732-echo-spaces-and/#findComment-1179258 Share on other sites More sharing options...
Pikachu2000 Posted February 24, 2011 Share Posted February 24, 2011 There's also nl2br, if the additional '\n' newlines aren't an absolute necessity. Quote Link to comment https://forums.phpfreaks.com/topic/228732-echo-spaces-and/#findComment-1179289 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.