needs_upgrade Posted October 30, 2008 Share Posted October 30, 2008 Hello guys. I have a string of characters in my mysql table (together with the newlines, multiple spaces, etc). I wanted to show the strings in HTML exactly how the user entered it. I used ereg_replace to replace '\n' with '<br>', multiple spaces with ' ' and tab with five ' '. My problem is with '\n'. It omits the letter n followed by the character new line. How should i do it? thanks guys Link to comment https://forums.phpfreaks.com/topic/130678-question-about-ereg_replace/ Share on other sites More sharing options...
JasonLewis Posted October 30, 2008 Share Posted October 30, 2008 Look into nl2br() to convert new line characters to HTML line breaks. Link to comment https://forums.phpfreaks.com/topic/130678-question-about-ereg_replace/#findComment-678159 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.