Formatting Line Breaks in Text Area - Needed

Hello,

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.

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

if(isset($_POST['comment']))
{
	echo "<div class=\\"fileRow admin\\">".stripslashes($comment)."";
}
?>

Yes, you should remove the stripslashes().

Did the trick, thanks a lot Jake!