title: Removing backslash with str_replace
body: <p>So I'm trying to remove a backslash (stored in database as in example - How\'s it going).</p>
  
  <p>What i want to do is to remove that backslash and keep the newlines and spaces aswell. </p>
  
  <p>I know that this does the trick : </p>
  
  <pre><code>str_replace('\\', '', $string); 
  </code></pre>
  
  <p>but the issue is that I have two other expressions aswell so right now I have: </p>
  
  <pre><code>str_replace('\\r\\n', "\r\n", $string);
  </code></pre>
  
  <p>How and where do I put in the '\\', '' in the second example without interferring with the newlines? </p>
  
  <p>I have simply tried <code>str_replace('\\r\\n\\', "\r\n ', $string)</code> and so on but I can't get it to work without messing up the newlines. </p>
  
  <p>Anyone who can help me?</p>
  
  <p>EDIT:</p>
  
  <p>What I have now to output the data is: </p>
  
  <pre><code>echo nl2br(str_replace('\\r\\n', "\r\n", $string));
  </code></pre>
  
  <p>Which displays a string stored in the db, <strong>How\'s it going?\r\n\r\nROW 3</strong> as:</p>
  
  <pre><code>How\'s it going?
  
  ROW 3
  </code></pre>
  
  <p>In a paragraph tag. </p>
  
  <p>So what I want is to keep the newlines intact. Stripslashes removes the newlines and puts the output in one row. </p>
  
  <p>When storing the data I'm using this clean function: </p>
  
  <pre><code>function clean($mysqli, $var) {
      $var = strip_tags($var);
      $var = htmlentities($var);
      $var = stripslashes($var);
      return $mysqli-&gt;real_escape_string($var);
  }
  </code></pre>
  
  <p>What could I adjust to keep the newlines and also remove the single backslash in words like <em>It's, what's, how's</em> etc..</p>
  
  <p><strong>EDIT: SOLVED</strong></p>