title: How to save Textarea input after convert line breaks as BR in SQL
body: <p>I use ckeditor in admin panel but in user submit form use simple textbox so user can input  text and submit. Problem is when user enter text in textarea with Line Breaks it saves as it in SQL. I want to add BR after each line in sql. </p>
  
  <p>For Example User Submits:</p>
  
  <pre><code>    ![F.R.I.E.N.D.S.:
  (F)ight for you.
  (R)espect you.
  (I)nvolve you.
  (E)ncourage you.
  (N)eed you.
  (D)eserve you and
  (S)tand by you.][1]![SCREENSHOT oF DB SAVE][2]
  </code></pre>
  
  <p>got saved in DB as it with next line showing in output. But I want to save in DB as:</p>
  
  <pre><code>    F.R.I.E.N.D.S.:&lt;br /&gt;
  (F)ight for you.&lt;br /&gt;
  (R)espect you.&lt;br /&gt;
  (I)nvolve you.&lt;br /&gt;
  (E)ncourage you.&lt;br /&gt;
  (N)eed you.&lt;br /&gt;
  (D)eserve you and&lt;br /&gt;
  (S)tand by you.
  </code></pre>
  
  <p>I use nl2br but its not working on user submit form If I use nl2br on admin processing form then on those fields already added with ckeditor it adds two BR tags.</p>
  
  <p>Code used on user submit form is:</p>
  
  <pre><code>&lt;textarea name="content" id="content" cols="60" rows="10" class="span7"&gt;&lt;?php if(isset($content)) { echo $content; } ?&gt;&lt;/textarea&gt;
  
  $content = trim($_POST["content"])
  $content = mysql_real_escape_string($content);
  $content = nl2br($content);
  </code></pre>
  
  <p>No processing is used on admin approval form where ckeditor used on textarea. Text output from DB appears without Line Breaks in a single line in ckeditor.
  if I use nl2br while output on this form it works but adds double BRs on earlier text posted through ckeditor.</p>
  
  <p>also tried <code>$content = preg_replace("/\r\n|\r/", "&lt;br /&gt;", $content);</code> as suggested by some one on stackoverflow on similar question </p>
  
  <p>pls suggest me some function for this problem.</p>
  
  <p>also suggest If I need to use some function like htmlentities or stripslashes to process content before Inserting into SQL.</p>