How do I add a file extension to this code so its looking for a .zip
So this script works perfectly if i do url.com?sn=123 - it will delete a file called 123, however how do add the .zip in the code so it actually says if file 123.zip exists then unlink 123.zip
<?PHP
if (file_exists($_GET["sn"])) {
unlink($_GET["sn"]);
} else {
// File not found.
}
?>
I tried doing this: (however it just errors)
<?PHP
$zip=".zip";
if (file_exists($_GET['sn'],['zip'])) {
unlink($_GET['sn'],['zip']);
} else {
// File not found.
}
?>