$zip = new ZipArchive;
$res = $zip->open('try.zip');
if ($res === TRUE) {
$zip->renameIndex(0,'newname.html');
$zip->extractTo('test/');
$zip->close();
} else {
echo 'failed, code:' . $res;
}
What is wrong with my code? the system didnt extract anything nor did it shows any error
The extract works perfectly if i remove rename.
But i can't get them to work together at the same time
$res = $zip->open('try.zip');
if ($res === TRUE) {
$zip->renameIndex(0,'newname.html');
$zip->extractTo('test/');
$zip->close();
} else {
echo 'failed, code:' . $res;
}
What is wrong with my code? the system didnt extract anything nor did it shows any error
The extract works perfectly if i remove rename.
But i can't get them to work together at the same time