kencur,sikencur,aplikasi,tips dan trik, informasi,aplikasi sekolah gratis,pendidikan,aplikasi sekolah,bejalar office

PHP Extract Zip File

php-extract-zip-file.png

php-extract-zip-file.png


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 $zip = new ZipArchive; //tes.zip is the file to extract  
if ($zip-&gt;open('test.zip') === TRUE) {
	$zip-&gt;extractTo(getcwd());
	$zip-&gt;close(); echo 'ok';
	}
else {
	echo 'failed';
	}
?>

Upload extractzip.php and test.zip to your web directory, then open up extractzip.php with your web browser. Look at your web directory, you will see the test.zip have been extracted. :D
Download PHP Extract Zip File.

Komentar

Tinggalkan Balasan

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