title: New line in PHP output in a text file
body: <p>My php form which saves the output in a text file glues the result to one string like:</p>
  
  <p>Name1Email1The Message1Name2Email2The Message2Name3Email3The Message3Name4Email4The Message4</p>
  
  <p>But I need spaces and/or newlines. I normaly don't use PHP so I don't get it. I did't find an answer on the web, also read some Q/A here, but this didn't help me.</p>
  
  <p>The Form:</p>
  
  <pre><code>&lt;form action="mailer.php?savedata=1" method="post"&gt;
  Your Name: &lt;input type="text" name="name"&gt;&lt;br&gt;
  Your Email: &lt;input type="text" name="email"&gt;&lt;br&gt;
  Your Message:&lt;br&gt; &lt;textarea name="message" rows="5" cols="30"&gt;&lt;/textarea&gt;&lt;br&gt;
  &lt;input type="submit" name="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The PHP</p>
  
  <pre><code>&lt;?php
  $savedata = $_REQUEST['savedata'];
  if ($savedata == 1){ 
  $data = $_POST['name'];
  $data .= $_POST['email'];
  $data .= $_POST['message'];
  $file = "YOURDATAFILE.txt"; 
  
  $fp = fopen($file, "a") or die("Couldn't open $file for writing!");
  fwrite($fp, $data) or die("Couldn't write values to file!"); 
  
  fclose($fp); 
  echo "Your Form has been Submitted!";
  
  }
  ?&gt;
  </code></pre>