The only text formatting you're likely to have in a text field from a html
form is line breaks (\n).

So, to keep the formatting of these breaks, insert the text into the DB as
is, then on pulling it out, convert \n's to <br />'s using nl2br($string),
so that the "newlines" appear within a HTML page.

Justin French


on 08/07/02 11:28 PM, Hawk ([EMAIL PROTECTED]) wrote:

> Lets say I have a guestbook, and I want the text the visitors write in it be
> saved in a database(mysql) and when retrieved, if should have the same
> textformating, I guess this is a really basic thing, but I don't know what
> to look for :)
> I've caught \n and ereg*, but I'm not sure that's the thing, help bitte .)
> 
> Håkan
> 
> 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to