title: Search file for word and delete line
body: <p>This is a second request on the same subject. I wasn't clear
  I needed the line to be deleted.</p>
  
  <p>I searched here and found part of a script that is suppose search for
  a word and delete the line. There seems to be a slight error with what
  I'm trying to do.</p>
  
  <p>I have an option list in a pull down. I would like for it to
  remove the line selected. The file choice.php that is called
  from the pull down page seems to be released when the php below
  is called called because there is no access denied, or violation
  errors.</p>
  
  <p>These are the errors I'm getting after adding the 3 last lines I
  was told I need.</p>
  
  <pre><code>fopen() expects at least 2 parameters, 1 given
  implode(): Invalid arguments passed
  fwrite() expects parameter 1 to be resource, boolean given
  fclose() expects parameter 1 to be resource, boolean given
  </code></pre>
  
  <p>Thanks in advance</p>
  
  <pre><code>&lt;?php
  //  Separate choice.php has the following pull down 
  //  Select item to delete from list
  //  &lt;option value="item1.php"&gt;Item 1&lt;/option&gt;
  //  &lt;option value="item2.php"&gt;Item 2&lt;/option&gt;
  //  ...... many items.
  
  $workitem = $_POST["itemtodelete"]; 
  
  $file = file("option.list.php");
  foreach( $file as $key=&gt;$line ) {
      if( false !== strpos($line, $workitem) ) {
        unset ($file[$key]);
      }
  }
  // Removed "\n"
  $file = implode("", $file);
  // Told to add this.
  $fp = fopen ("option.list.php");
  fwrite($fp,implode("",$file);
  fclose ($fp);
  
  ?&gt;
  </code></pre>