title: changing new line to <br> in text area
body: <p>My problem is pretty simple. I want to change new lines in text area to <code>&lt;br&gt;</code> tags BUT I need the final string to be one-line text. I tried using <code>nl2br</code> function but as a result I get string with <code>&lt;br&gt;</code> tags and new lines. I also tried to simply replace &amp;#013 or &amp;#010 symbols with <code>&lt;br&gt;</code> using <code>str_replace</code> but it doesn't work.<br>
  Here is sample of my latest code:<br></p>
  
  <pre><code>Godziny otwarcia: &lt;textarea name="open" rows="3" cols="20"&gt;'."$openh".'&lt;/textarea&gt;
  &lt;input type="submit" name="openb" value="Zmień"/&gt;&lt;br&gt;
  </code></pre>
  
  <p><br></p>
  
  <pre><code>    if($_POST['openb']) {
      $open = $_POST['open'];
      str_replace('&amp;#010', '&lt;br&gt;', $open);
      change_data(21, $open);
  }
  </code></pre>
  
  <p>The <code>$openh</code> is result of this:</p>
  
  <pre><code>$tab = explode('&lt;br&gt;', $openh);
  $openh = null;
  for($i=0;$i&lt;count($tab);$i++)
      $openh = $openh . $tab[$i] . '&amp;#013';
  </code></pre>
  
  <p>(yes, I know i could use <code>str_replace</code>, don't ask why I did it this way)<br>
  and the original <code>$openh</code> is <code>$openh = 'Pon-pt 9:00-17:00&lt;br&gt;Środa 12:00-17:00'</code><br>
  <br>
  Also you may want to see my <code>change_data</code> function as it is connected to why i need the string to be in one line, so here it is:</p>
  
  <pre><code>function change_data($des_line, $data) {
      $file = 'config.php';
      $lines = file($file);
      $i=1;
      foreach($lines as $line_num =&gt; $line) {
          $wiersz[$i] = $line;
          $i++;
      }
      $change = explode("'", $wiersz[$des_line]);
      $wiersz[$des_line] = $change[0] . "'" . $data . "'" . $change[2];
      $i = 1;
      $f = fopen($file, w);
      while($i &lt;= count($wiersz)) {
          fwrite($f, $wiersz[$i]);
          $i++;
      }
      fclose($f);
      header('location: index.php?p=admin');
  }
  </code></pre>
  
  <p>I'm not PHP specialist so sometimes I do things little "hard" way.. I had huge problems with reading file <code>config.php</code> line by line and these are results of my few-hours effort :(</p>