I think the answer you are looking for depends on the output you need.
I would be inclined to use the following
function mynl2br($text){
return ereg_replace("\n", "<br />\n", $text);
}
this will preserve the trailing \n just like nl2br but will work on all encountered \n s
however you could just use
function mynl2br($text){
return ereg_replace("\n", "<br \>", $text);
}
and that would actually replace the \n with <br > tags
if you are concerned about the carriage returns and the newline character you will need to do what your previous post implied. The carriage returns do export nastily in Excel they make those strange looking box thingies.
I believe you can also use the
str_replace
function to do the same things
Hope that helps,
Geoffrey