ZIP Extract dengan PHP


Script untuk mengextract file zip dengan PHP, semoga bermanpaat bagi yang membutuhkan😀

$zip = new ZipArchive;
$data = $zip->open(’namadata.zip’);
if ($data == TRUE) {
$zip->extractTo('lokasi-untukdiextract/');
$zip->close();
echo 'Unzip berhasil';
} else {
echo 'gagal di extract';
}

3 thoughts on “ZIP Extract dengan PHP

  1. nice share gan….tp tu kyak e manggil kelas ZipArchive ya???trus file yang berisi class ZipArchive tu kok nggak di include kan???mang skrip class ZipArchive tu bagaimana????

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s