title: \r\n showing up in <textarea> after pulled from database
body: <p>the data is captured from a textarea to begin with.</p>
  
  <p>Line1
  Line2
  Line3
  etc</p>
  
  <p>It is sent through this function before being stored in the DB (i'm open to better solutions, but if PDO is one of them, I don't understand it and have yet to get it to work)</p>
  
  <pre><code>function test_input($data) {
      global $conn;
  
      $data = trim($data);
      $data = stripslashes($data);
      $data = htmlspecialchars($data);
      $data = mysqli_real_escape_string($conn, $data);
  
      return $data;
  }
  </code></pre>
  
  <p>Which is my way of preventing injections (not my way but a way I found that has worked great until now its giving me this problem with line breaks and textareas)</p>
  
  <p>I try to extract the data from the DB and display it in a textarea, and it shows \r\n instead of doing a line break.  It is stored in the DB with the line breaks (i do not see the \r\n but instead i see the data on a new line)</p>
  
  <p>I've tried nl2br, i've tried html_entity_decode, i've tried str_replace \r\n to br (and then it just shows br literal instead of \r\n).</p>
  
  <p>from the research I've found on this site, its the stuff i'm doing to it before i store it in the DB that is causing this but none of the solutions have worked for me.</p>
  
  <p>help.</p>