title: Adding a line break to php Fwrite output
body: <p>Basically, I was trying to find a simple piece of code for a simple note taking thing in html, I want to type in an html input form, then that input be added on to a text file i found this,</p>
  
  <pre><code>&lt;h1&gt;Adding a text block to a text file:&lt;/h1&gt;
  &lt;form action="index.php" method='post'&gt;
  &lt;textarea name='textblock'&gt;&lt;/textarea&gt;
  &lt;input type='submit' value='Add text'&gt;
  &lt;/form&gt;
  
  &lt;?php
  
  // Open the text file
  $f = fopen("text.html", "a");
  
  // Write text
  fwrite($f, $_POST["textblock"]); 
  
  // Close the text file
  fclose($f);
  
  // Open file for reading, and read the line
  $f = fopen("text.html", "r");
  
  // Read text
  echo fgets($f); 
  fclose($f);
  
  ?&gt;
  </code></pre>
  
  <p>Which works, but needs line breaks at the end of the output, such as if i wrote "test" and then "test" again, it outputs as "testtest" obviously, but I want two line breaks between them, like</p>
  
  <p>"Test</p>
  
  <p>Test"</p>
  
  <p>I also want to add another input called "Subject" which will be the subject of the note,I'm open to any suggestions, if this code is wrong, or over complicated, then feel free to shorten it or just give me a entirely new one.</p>
  
  <p>Thanks for any help</p>
  
  <p>Terry.</p>