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