title: can't replace \n in php with content from database
body: <p>I try to avoid asking stupid questions, but this for some reason is just not working. I'm retrieving some text from a database, with newlines included. When using echo straight away, this is the output:</p>
  
  <pre><code>=== BOLD TEXT ===\nHere is some text.
  </code></pre>
  
  <p>This is how i retrieved it:</p>
  
  <pre><code>$row = $query-&gt;row();
  $content=$row-&gt;course_content;
  </code></pre>
  
  <p>Neither of the following have any effect.....</p>
  
  <pre><code>$content= str_replace(array("\r\n", "\r", "\n"), "&lt;br /&gt;", $content); 
  $content= str_replace("\n", " ", $content);
  $content = nl2br($content);
  </code></pre>
  
  <p>HOWEVER, when i hard code it in a string to the original statement,</p>
  
  <pre><code>$content="=== BOLD TEXT ===\nHere is some text.";
  </code></pre>
  
  <p>pang! it works... any ideas as to why it refuses to accept the database input, but is fine with the manual string?</p>
  
  <p>Complete Code: </p>
  
  <pre><code>//Switch between these two:
  $row = $query-&gt;row();
  $content=$row-&gt;course_content;
  $content="=== BOLD TEXT ===\nHere is some text.";
  $content = str_replace(array("\r\n", "\r", "\n"), "&lt;br /&gt;", $content); 
  $content = str_replace("\n", " ", $content);
  $content = nl2br($content);     
  echo $content;
  </code></pre>