Recent Post

Dear reader, this blog has been moved to here

Friday, 15 November 2013

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();
?>

Email Newsletter



Smiley :)
:D
:)
:[
;)
:D
:O
(6)
(A)
:'(
:|
:o)
8)
(K)
(M)

No comments:

Post a Comment