PHP Extract Zip File

PHP Extract Zip File. This article is a continuation of previous articles php create zip file. Once we can create zip file with php, then we will extract the zip file. If you have not to read php create zip file, please read it.

Ok, we go to extract the zip file with php, we begin by making extractzip.php. Fill the file with the following php script :

PHP Extract Zip File script

$zip = new ZipArchive; 
// is the file to extract  
if ($zip-&gt;open('') === TRUE) {
	$zip-&gt;close(); echo 'ok';
else {
	echo 'failed';

Upload extractzip.php and to your web directory, then open up extractzip.php with your web browser. Look at your web directory, you will see the have been extracted. :D

Published by

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *