title: PHP Remove line containing string from a text file
body: <p>I have a file that looks something like this.</p>
  
  <pre><code>Kate
  Johnny
  Bill
  Kermit
  </code></pre>
  
  <p>I want to be able to put, for example, "Bill" into a string, and remove "Bill", or whatever is in the variable, and the subsequent "\r\n" from the file. The variable will always contain something that is already in the file, there won't be "George" if there is no George.<br/>
  This code checks if "Bill" is in file.</p>
  
  <pre><code>$fileContents = file_get_contents("names.txt");
  if(strpos($fileContents, "Bill"))
  {
      //Bill is here!
  }
  </code></pre>
  
  <p>How would I expand upon this to remove "Bill\r\n"? Thanks in advance!</p>