True. I was assuming that the text was going to be final and not being
edited again.

If you do have a lot of textareas to work around with, why don't you give
TinyMCE a try. Thats the best option you have got. It replaces the textarea
into more of a html compatible one and when you are editing the text again,
it will be properly formatted.

You'll also get toolbars for text editing etc., more like your mail compose
window right now. :)


On Fri, May 15, 2009 at 7:56 PM, Robert Cummings <rob...@interjinn.com>wrote:

> On Fri, 2009-05-15 at 19:48 +0530, Manoj Sterex wrote:
> > Well, instead of storing the text from the textarea directly into the db,
> > validate it and wrap it with <br /> tags (replace \n) and then store it.
> > This way you needn't use nl2br every time you retrieve the text from db.
> Don't do that unless it's a cached entry in the DB. Unless you
> absolutely know you'll never need the raw text again, you should always
> store the raw text so it can be processed in the future in any way you
> see fit. If you want to speed up the process of conversion, use an
> additional field in the database, or a cache, that contains the
> processed content.
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to