How is it possible to delete the listed files in php?
<p>How can I delete all the listed files using PHP?  As shown in the code, it displays all the files in the folder with a "Delete" button next to each one... but how can I use the <code>unlink</code> function to delete the particular file when its "Delete" button is clicked?</p>

<pre><code>function Deletion()
{
    $files1 = scandir('upload/');
    $ignore = array( 'cgi-bin', '.', '..');
    foreach ($files1 as $file1) 
    {
        if(!in_array($file1, $ignore)) 
        {
            echo '&lt;div&gt;
                   &lt;img src="upload/' . $file1 . '" height="50px" width="50px" /&gt;
                   &lt;input type="button" value="Delete" name="del"/&gt;&lt;br&gt;
                   &lt;a href="upload/'.$loca.'/'.$file1.'" target="_BLANK"
                     style=" font-size:12px; color:#333;"&gt;&lt;p &gt;'.$file1.'&lt;/p&gt;&lt;/a&gt;
                  &lt;/div&gt;';         
        }
    }
}
</code></pre>
