You can also use this method:
$ext = end(explode(".", $files));
Then use a switch construct to figure different filetypes:
switch ($ext){
case "zip":
echo"This is a compressed zip file.";
break;
case "png":
echo"This is a .png image.";
break;
default:
echo"This file is unknown.";
break;
}
Note that this method also works for filenames like this.is_a.zipfile.zip.