Q:

Delete two files from server in different folder but same name PHP

I store all pictures in one folder called pictures,, inside that is a folder called thumbnails which stores a generated thumbnail at upload time under the same name.
Sometimes I need to overwrite or just delete the picture and the thumbnail.
Originally I had the file in the picture folder and the thumbnail folder so didn't need to specify a path, but have had to remove it from the and unsure how to use the paths. I can delete the picture the old way, or the thumbnail, but can't work out how to get both at once.
<?php
$picpath = "pictures/";
$thumbpath = "pictures/thumbnails/";

if (isset($_POST['submit'])) 
{
$fruit_name = $_POST['fruit_name'];
if (file_exists($fruit_name)) {
    unlink($fruit_name);
  echo ("$fruit_name deleted.");
  }
else
  {
  echo ("$fruit_name not deleted, is this a valid name?");
  }
}
?>

A:

You'll need to delete one image first and then the second afterwards.
Something like this:
$fruit_name = $picpath . $_POST['fruit_name'];
$fruit_thumb = $thumbpath . $_POST['fruit_name'];
if (file_exists($fruit_name)) {
    unlink($fruit_name);
    unlink($fruit_thumb);
  echo ("$fruit_name deleted.");
  }

