"Jon" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Nevermind, I found some code at last which actually works :
>
> $txt = preg_replace("/(\015\012)|(\015)|(\012)/","<BR>",$txt);
>

rather than using a regular expression, try:

$txt = strtr($txt, array("\r\n" => "<br />", "\n" => "<br />", "\r" => "<br
/>"));

This is probably faster, see http://www.php.net/strtr for details.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to