How to Extract a Zip file Using PHP

Below is a little snippet of what you are looking for


<?php
## Define zip file name
define('FILENAME','vpn.zip');##Zip Archive name
define('DIR_LOC','zip');## directory to exract the files to

//Start new ZipArchive
$zip = new ZipArchive;

//Opening the file name you defined
$zip->open(FILENAME);

//Extrating file
$zip->extractTo(DIR_LOC);

//We are done, closing connection...
$zip->close();
?>
Posted in: