I'm using XAMPP to test a mini-website - I have some zip files I'd like to be able to place on the server, then for them to be unzipped using PHP via a browser.
How can I do this?
I've tried the following...
<?php
$zip = new ZipArchive;
$res = $zip->open(’zipfile.zip’);
if ($res === TRUE) {
$zip->extractTo(’extracted/’);
$zip->close();
echo ‘ok’;
} else {
echo ‘failed’;
}
?>
and several other suggestions I've found around the net, but none of them work.
any help much appreciated!