hello.
i use the nl2br function when i insert large selections of text into a database as shown below:
$body = nl2br($body); //$body is the text
mysql_query("insert into $table set body='$body'");
As you may know, when using nl2br, it inserts breaks in the following way:
paragraph 1
<br>
<br>
paragraph 2
When i go to update the database, nl2br is run again, and the text ends up looking like this:
paragraph 1
<br>
<br>
<br>
<br>
paragraph 2
The problem is that nl2br is leaving a space between the <br>'s it places so every time it is run, more <br>'s will be placed.
help!
thanks in advance.