Formatting Line Breaks in Text Area - Needed


I am having some trouble with line breaks passing through a textarea to the database. I understand a few of the methods when reading a bit, though there seems to be a few different methods to accomplish a clean display from a textarea.

I would appreciate any assistance.

Thanks in advance!

I assume you mean to convert it so that it’s viewable in HTML?

The simplest approach would be to use nl2br().

The comments on that page should also help you.

Thanks Jake, I am giving this a go right now.

Well it seems that I am getting a similar variation returning “rnrn” on new lines in the submitted data.

Perhaps my glitch is obvious to you, this is the original code snip I am working with.

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
	$text = stripslashes($row['text']);
	if(!$row['isadmin'] == 1)
		echo "<div class=\\"fileRow\\">".$text."";
		echo "<div class=\\"fileRow admin\\">".$text."";

	echo "<div class=\\"fileRow admin\\">".stripslashes($comment)."";

Yes, you should remove the stripslashes().

Did the trick, thanks a lot Jake!