Page 2 of 2
Posted: Tue Sep 03, 2002 9:30 am
by twigletmac
AFAIK, and from the
php manual:
php docs wrote:nl2br -- Inserts HTML line breaks before all newlines in a string
so removing the HTML line breaks it's put in shouldn't affect the newlines.
Mac
Posted: Tue Sep 03, 2002 9:33 am
by gite_ashish
from php man:
Note: Starting with PHP 4.0.5, nl2br() is now XHTML compliant. All versions before 4.0.5 will return string with '<br>' inserted before newlines instead of '<br />'.
Posted: Tue Sep 03, 2002 11:30 am
by Takuma
Code: Select all
<?php
str_replace("<br />","\n",$string);
?>
Posted: Tue Sep 03, 2002 11:43 am
by twigletmac
Takuma wrote:Code: Select all
<?php
str_replace("<br />","\n",$string);
?>
Then you'll end up with double newlines because nl2br() doesn't replace the newlines it simply puts an HTML linebreak in front of them.
Mac