/ Published in: PHP
A few days ago i was looking for a script witch one will help me to unzip a file using PHP . There is 2 different ways to do it.One just execute a commend to unzip the file in the shell using PHP and another one is using library functions
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php // create object $zip = new ZipArchive() ; // open archive if ($zip->open(’archive. zip’) !== TRUE) { } // extract contents to destination directory $zip->extractTo(’/ tmp/extracted/ ‘); // close archive // print success message $zip->close(); echo ‘Archive extracted to directory’; ?>
URL: http://ranacse05.wordpress.com/2008/03/20/unzip-file-using-php/