(PHP 5 >= 5.2.0, PHP 7, PECL zip >= 1.1.0)
ZipArchive::extractTo — ��ѹ���ļ�
destination
��ѹ���ı���Ŀ��·��
entries
��ѹ�����ļ���������һ���������ļ�����һ���ļ������顣
�ɹ�ʱ���� TRUE
�� ������ʧ��ʱ���� FALSE
��
Example #1 Extract all entries
<?php
$zip = new ZipArchive;
if ($zip->open('test.zip') === TRUE) {
$zip->extractTo('/my/destination/dir/');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
?>
Example #2 Extract two entries
<?php
$zip = new ZipArchive;
$res = $zip->open('test_im.zip');
if ($res === TRUE) {
$zip->extractTo('/my/destination/dir/', array('pear_item.gif', 'testfromfile.php'));
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
?>