Here is my function:
<? function nl2p($str)
{
return str_replace('<p></p>', '', '<p>' . preg_replace('#\n|\r#', '</p>$0<p>', $str) . '</p>');
}
?>
I need to change the regular expression pattern #\n|\r# to something that will only wrap paragraph tags around carriage returns and not new lines.