<?php
unlink('test.html');
?>

<?php
unlink('images/01.svg');
unlink('images/thumbs/01.svg');
echo'<center> <h2> FILES IS DELETED SUCCESFULY </h2> </center>';
?>

<?php
$delete = '08.jpg';
unlink("aaa/$delete");
unlink("aaa/thumbs/$delete");
echo "<center> <h2> '$delete' FILES IS DELETED SUCCESFULY </h2> </center>";
?>


how to image delete in folder and dtatbase refer:-
https://www.pakainfo.com/delete-image-from-folder-in-php/


<?php 
if(isset($_GET['deleteid']))
   {
      $querySelect = "select * from galleries where id = ".$_GET['deleteid'];
      $ResultSelectStmt = mysqli_query($conn,$querySelect);
      $fetchRecords = mysqli_fetch_assoc($ResultSelectStmt);
      
      $fetchImgTitleName = $fetchRecords['image'];
      
      $createDeletePath = "uploads/".$fetchImgTitleName;
      
      if(unlink($createDeletePath))
      {
         $liveSqlQQ = "delete from galleries where id = ".$fetchRecords['id'];
         $rsDelete = mysqli_query($conn, $liveSqlQQ);   
         
         if($rsDelete)
         {
            header('location:index.php?success=true');
            exit();
         }
      }
      else
      {
         $displayErrMessage = "Unable to delete Image";
      }
      
   }
?>