Instead of using "str_replace", try using "ereg_replace", and instead of replacing "\n\n", try replacing "\r\n".
Basically, try replacing the line that says "$string=str_replace("\n\n","<p>",$string);
with something like:
"$string=ereg_replace("\r\n", "<p>", $string);"
and see how well that works.
Further, if you are wanting to trim off the whitespace (which is pretty common), you can do pretty much everything on one line, like so:
$string = strip_tags(trim(ereg_replace("\r\n", "<p>", $string)));
Hope this helps.
-9mm-