Starting from PHP 4.3.10 and PHP 5.0.2, this should be the most correct way to replace <br /> and <br> tags with newlines and carriage returns.<?phpfunction br2nl ( $string ){ return preg_replace('/\<br(\s*)?\/?\>/i', PHP_EOL, $string);}?>(Please note this is a minor edit of this function: http://php.net/nl2br#86678 )You might also want to be "platform specific", and therefore this function might be of some help:<?phpfunction br2nl ( $string, $separator = PHP_EOL ){ $separator = in_array($separator, array("\n", "\r", "\r\n", "\n\r", chr(30), chr(155), PHP_EOL)) ? $separator : PHP_EOL; return preg_replace('/\<br(\s*)?\/?\>/i', $separator, $string);}?>