replacing carriage returns with
On Tue, 19 Aug 2003 14:42:10 +0100 in
<message-id:bht97i$1si$1@newsg2.svr.pol.co.uk>
2 options, if you're using HTML (rather than XHTML), you can use the
simple 'nl2br()' built-in function:
$text = nl2br($text);
If you're using XHTML.. AFAIK, there is no built-in wrapper for this, so
you could use a function that I wrote a while back:
function nl2xbr($data) {
return (!empty($data)) ? str_replace("\n", "<br />\n", $data) : '';
}
HTH =)
Regards,
Ian
--
Ian.H [Design & Development]
digiServ Network - Web solutions
http://www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.
|