On Mon, 11 Sep 2000, adam beecher wrote:
> > $details = ereg_replace(10, "<BR>", $details);
> > $details = ereg_replace(13, "", $details);
> > And that will add a <br> to all the $details when it comes across a
> > linefeed.
> Ummm, wha about nl2br()? Actually, nl2br() is imperfect - it screws up layouts
> because it doesn't really replace newlines, it just adds in a <BR> tag. If you
I asked this question on phpbuilder.com before and got the following
nl2br() is probably not the best way to do it.
The following will replace blank lines with <P> and allow the the rest of the
copy to "flow" naturally.
$message = ereg_replace("\r\n\r\n", "\n<P>", $message);
It worked fine for me (in a message board application).
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!