I use functions like nl2br() and stips to make sure all the text a user enters into my database is formatted properly. There are a number of users who want to submit info to my database who don't understand html at all, and as such I want to keep the process as non-html as possible. So as far as submitting the text goes, I think I've managed this.
The function nl2br() means that the text is stored in the database with BR tags. I know BR tags arn't exactly complicated, but I want to keep all html out of the equation when it comes to the users' end.
Heres the problem, then. Users are able to update the information they stored into the database. They do this by logging in, and going to a page with a load of text fields, each with value=$row['x'] - in other words, all their info from the database is transfered into the text fields, so that if they only want to edit a word or two, they dont need to retype the whole thing. But due to the fact that the text was stored in the database with BR tags, loads of <BR>s appear in the text fields, which is a problem for people who dont know what it means - and I personally want to keep all the code hidden behind the cosmetics.
My question, then, is this: Is it possible to reverse nl2br... ie br2nl()? It cant be that common I know, because if you printed <BR>, then you DO get a new line. But if its the value of a text field, it'll be shown. Any ideas appreciated,
Cheers,