How can I delete the files from array in database, and from directory on button click. I have this code which has deleted all the files in that folder but still showing the file names. I am looking to delete specific file from directory folder and array in database on button click.
echo '<ul>';
foreach (explode(',', $msg_rows['msg_files']) as $file){
echo '<li><a href="../files/wcfiles/'.$msg_rows['msg_order_id'].'/'.$file.'">'.$file.'</a> 
<a class="btn btn-danger btn-xs" href="../files/wcfiles/'.$msg_rows['msg_order_id'].'/'.unlink($file).'">Delete</a></li>';}
echo '</ul>';