How to extract a zip file using php

php

Posted on 18 Jun 15 by Vickey
  437



By using the below code we can extract or unzip a zip file in php

$path_of_zip='testfile.zip';
$unzip = new ZipArchive;
$unzip->open($path_of_zip);
if($unzip->open($path_of_zip))
{
     $unzip->extractTo('/path/extract');
}
$unzip->close();

 


If this post help you reduce time to develop, you can help me to maintain this website :)
www.000webhost.com