how about
$rtf = str_replace("\n",'\par ',$textarea);
diafol
Rhod Gilbert Fan (ardav)
7,800 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
Could I ask, why is there a
in the string anyway? If the text is coming from a textarea - don't use nl2br.
Try this:
$rtf = str_replace("\n", "\\par ", $textarea);
diafol
Rhod Gilbert Fan (ardav)
7,800 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
str_replace takes arrays as parameters- so prob. no need for your loops
diafol
Rhod Gilbert Fan (ardav)
7,800 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080