title: how to delete a file from folder in php
body: <p>I have a folder <code>'items'</code> in which there are 3 files <code>item1.txt, item2.txt and item3.txt.</code>
  I want to <code>delete item2.txt</code> file from folder. I am using the below code but it not deleting a file from folder. Can any body help me in that.</p>
  
  <pre><code>&lt;?php
          $data="item2.txt";
          $dir = "items";
          $dirHandle = opendir($dir);
          while ($file = readdir($dirHandle)) {
              if($file==$data) {
                  unlink($file);
              }
          }
  
          closedir($dirHandle);
  
  ?&gt;    
  </code></pre>