This will extract a zip file via PHP. Just be sure to set the $file and $path variables. $file represents the zip file name which may or may not contain a path. $path represents the directory to extract the files to. It will determine if the file is gz or zip and act accordingly. This uses the command line so be aware of the security risk.
Be very careful to double check $file if you take it from $_GET or $_POST
This can be used in conjunction with my Wget FTP CSV Datafeed Import Script
$path = '/extracted';
$file = 'zipfile.gz';
$path_parts = pathinfo($file);
$ext = $path_parts[extension];
if($ext == 'gz')
{
$execute = "gunzip -".$path." $file";
`$execute`;
}
if($ext == 'zip')
{
$execute = "unzip -u $file -d $path";
`$execute`;
}