note 19087 deleted from function.nl2br by aidan
| From: | aidan@php.net | Date: | Sun, 10 Oct 2004 10:39:29 +0000 |
| Subject: | note 19087 deleted from function.nl2br by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78285@lists.php.net to get a copy of this message | ||
Note Submitter: yann_cochard at yahoo dot fr
----
php@fendforyourself.com wrote :
> Someone asked why there was no br2nl(). I think it's probably in most
> cases you want to take your data and display it in HTML, so it is probably
> already stored with the \n. Storing it with the BR's instead would just
> take up extra space and there's no point in doing that when you can always
> convert it on display.
A br2nl could be of use : if you want to allow a visitor to modify a data stored in the database,
you display this data in a textarea. Showing BR's is quite ugly, a br2nl would then be
convenient. However it would be client-OS dependant, so more difficult to set up.
I prefer to convert before storing, even if it takes more space, because in the other case I would
have to convert it for EACH display. So I lose on the space side, but I win on the speed one. For my
hosting, hard drive capacity is cheaper than CPU.
Just my 2 (euro)cents. ;-)
Yann