note 42572 deleted from function.nl2br by aidan

From: Date: Sun, 10 Oct 2004 10:36:03 +0000
Subject: note 42572 deleted from function.nl2br by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-78272@lists.php.net to get a copy of this message
Note Submitter: bullet ---- 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.

« previous php.notes (#78272) next »