Forum Moderators: coopster

Message Too Old, No Replies

Convert White Spaces?

str_replace() ?

         

Willis

6:02 pm on Apr 26, 2004 (gmt 0)

10+ Year Member



Simple question really . . when it comes to using a form and specificly a "textarea", I wanna convert line returns to a "<br>" before it gets inserted into my database. Also be capable later switching it back. *Editing page - existing info fed into textarea*

I thought at first maybe a str_replace but. . *shrugs*

coopster

6:16 pm on Apr 26, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Is it necessary that you store the <br>eaks in the database? If not, store them as newlines and then use PHP's nl2br [php.net] function when you want to display the data.