title: Replace \n with '' by using str_replace() in PHP
body: <p>I have the following code </p>
  
  <pre><code>$s = '\n test@gmail.com \n ';
  $s = str_replace('\n', '', $s);
  
  echo $s;
  </code></pre>
  
  <p>I want to replace the <code>'\n'</code> char with <code>''</code> but it's not working with the above code. I have found that as <code>\n</code> is the new line char with ascii value 10 by <code>echo ord(substr($s, 0, 1));</code> it is not working. It's not clear to me what is the exact reason behind not working the above code. please help.</p>