...

View Full Version : nl2br



latemodern
08-25-2007, 02:45 PM
Hi,

I am using the nl2br() function to add line breaks (rn) to text before storing in a database. Problem is that on my edit page I'm getting these characters echoed. Is there a way of stripping these out - ie. reversing nl2br?

Thanks

Chris

kbluhm
08-25-2007, 03:10 PM
Why are you storing them?

Don't store them... call the text from the database and add the breaks when you display it. There will be less data to store and you'll be able to do more with the text in the long run.

firepages
08-26-2007, 11:42 AM
<?
$str=str_replace("<br />","\n",$str);
?>


but kbluhm is quite right.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum