title: PHP - delete text from a txt file
body: <p>I have subscribe feature on my site which consists of a simply form in which the user types their email and round the following PHP:</p>
  
  <pre><code>$database = "emails.txt"; 
  $file = fopen($database, "a+");
  $size = filesize($database);
  $email = $_POST['email'];
  if($_POST['submit']) fwrite($file, "$email,");
  if($_POST['submit']) echo "&lt;p style='color:white; margin-top:25px;'&gt;*Check your inbox*&lt;/p&gt;";
  ?&gt;
  </code></pre>
  
  <p>How can I set up a unsubscribe feature where the user types their email into a form and it is then removed from the .txt file? </p>