"George Hill" <ge********@europe.NOSPAM.com> wrote in message
news:bq**********@phys-news1.kolumbus.fi...
Hi
I recently started to use nl2br() when displaying
text from a mysql database. This works as expected
but I am unsure how to prepare data before inserting
it to a table. How can I make sure that new line characters,
\n, are properly preserved with the data to be inserted?
thanks,
GH
This is something alot of people go about the wrong way.
You should not alter the \n's when inserting, only when displaying to the
public.
Simply do this when displaying:
$text=ereg_replace("\n","<br>",$text);
echo $text;
Regards
Richard Grove
http://shopbuilder.org - ecommerce systems
Become a Shop Builder re-seller:
http://www.affiliatewindow.com/affil...ls.php?mid=611 http://www.affiliatewindow.com/a.pl?590