PHP
Header(Content-type:text/html;charset=utf-8);
error_reporting(E_all);
Set_time_limit(0);
$zip _filename = "Test.zip";
$zip _filename = key_exists(Zip, $_get) && $_get[Zip]?$_get[Zip]:$zip _filename;
$zip _filepath = Str_replace(\, /, dirname(__file__)) . / . $zip _filename;
if(!Is_file($zip _filepath))
{
die(file ".$zip _filepath."There is no!");
}
$zip = Newziparchive ();
$rs = $zip -Open ($zip _filepath);
if($rs !== TRUE)
{
die(Decompression failed! Error Code:. $rs);
}
$zip -Extractto (./);
$zip -Close ();
Echo $zip _filename.Unzip successfully!;
?>
The code is simple, but it's a good freshman handbook.
Zlib support required in PHP configuration
Win is thephp_zip.dll
http://www.bkjia.com/PHPjc/486234.html www.bkjia.com true http://www.bkjia.com/PHPjc/486234.html techarticle PHP Header (content-type:text/html;charset=utf-8); error_reporting (E_all); set_time_limit (0); $zip _filename = "Test.zip"; $zip _filename = key_exists (Zip, $_get) $_ ...