Unzip PHP

<?php $file = 'file.zip'; $zip = new ZipArchive; $res = $zip->open($file); if ($res === TRUE) { $zip->extractTo('./'); $zip->close(); echo 'ok'; } else { exec("unzip $file 2>&1", $out); print(implode("<br>", $out)); } ?>

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.