note 42572 added to function.nl2br
| From: | bullet at rn2 dot php dot net | Date: | Fri, 21 May 2004 20:23:30 +0000 |
| Subject: | note 42572 added to function.nl2br | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69922@lists.php.net to get a copy of this message | ||
Several people have commented that its smarter to not use nl2br and simply insert the data into the
database as plain text and do the nl2br on display to save headaches.
I just wanted to note as a system admin and php coder, that in MOST cases when running in a web
environment it would be far preferrable to convert the data ONCE before inserting it in the
database, and then convert back at a later date if and when someone needs to edit it.
On a heavily loaded site you could be talking about running the nl2br conversion 100,000 times a day
instead of 1.. surely this is worth the extra couple of KB the line break tags will take up on disk
- since for most web circumstances CPU is more expensive than Disk space.. anyhow.. thats my two
cents.
Even if your site doesnt get a ton of traffic its good to strucutre your code this way - otherwise
you may find problems once you gain the traffic you want.
----
Manual Page -- http://www.php.net/manual/en/function.nl2br.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42572
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42572&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42572&report=yes
Search -- http://master.php.net/manage/user-notes.php