Click to See Complete Forum and Search --> : New Line special character CRISIS!


johannesburgboy
04-11-2003, 04:14 PM
Please help me.

I have written a discussion board that accepts text from a user and saves it to a sql database.

When the data is sent from the clients browser to the server it performs the following functions:

reply1 = replace(reply1,"'","''")
reply1 = replace(reply1,". ",".<br>")
reply1 = replace(reply1,"; ",";<br>")
reply1 = replace(reply1,"? ","?<br>")
reply1 = replace(reply1," ","<br><br>")
reply1 = replace(reply1,"??????","<br><br>")

obviously to do all the neccessary changes so that when it gets displayed it will be displayed like it was written.
I can't get a "\n" character or line break or new paragraph to work. Please help. I am in deep crap if it does not work soooon.

Please help me to figure out what I am supposed to enter in the space of the '???????' to get it replaced with <br><br> or </p>.

Klyve1
04-12-2003, 09:54 AM
Are you trying to make the text have the line breaks that it had when input?

If so, have you tried the nl2br() function?

nl2br($data);

I'm kinda assuming your using PHP here by the way! :)