title: PHP str_replace not working correctly
body: <p>I'm using str_replace and it's not working correctly.
  I have a text area, which input is sent with a form. When the data is received by the server, I want to change the new lines to ",".</p>
  
  <pre><code>$teams = $_GET["teams"];
  $teams = str_replace("\n",",",$teams);
  echo $teams;
  </code></pre>
  
  <p>Strangely, I receive the following result</p>
  
  <p>Chelsea</p>
  
  <p>,real</p>
  
  <p>,Barcelona</p>
  
  <p>instead of Chealsea,real,Barcelona.</p>
  
  <p>What's wrong?</p>