title: Replacing \r\n with PHP
body: <p>I have a post form, which inserts my text in a MySQL database.</p>
  
  <p>I use </p>
  
  <pre><code>$post_text = mysql_real_escape_string(htmlspecialchars($_POST['text']));
  </code></pre>
  
  <p>and want to replace the <code>\r\n</code> which was automatically added.</p>
  
  <p>I tried </p>
  
  <pre><code>$text = str_replace('\\r\\n','', $text);
  $text = str_replace('\r\n','', $text);
  $text = str_replace('\\R\\N','', $text);
  $text = str_replace('\R\N','', $text);
  $text = str_replace('/\r\\n','', $text);
  $text = str_replace('/r/n','', $text);
  $text = str_replace('/\R\\N','', $text);
  $text = str_replace('/R/N','', $text);
  </code></pre>
  
  <p>but <code>\r\n</code> is always included in my database entries.</p>
  
  <p>How can I fix this?</p>