Make attention when using this function with apache & windows system. Windows file system use \ (backslash) instead of unix / (slash)
Use str_replace like this.
<?php
$zip = new ZipArchive;
if ($zip->open("file.zip)){
$path = getcwd() . "/dirToextract/";
$path = str_replace("\\","/",$path);
echo $path;
echo $zip->extractTo($path);
$zip->close();
echo 'Done.';
} else {
echo "Error";
}
?>
----
Server IP: 213.92.11.19
Probable Submitter: 81.174.46.212
----
Manual Page -- http://www.php.net/manual/en/function.ziparchive-extractto.php
Edit -- https://master.php.net/note/edit/86103
Del: integrated -- https://master.php.net/note/delete/86103/integrated
Del: useless -- https://master.php.net/note/delete/86103/useless
Del: bad code -- https://master.php.net/note/delete/86103/bad+code
Del: spam -- https://master.php.net/note/delete/86103/spam
Del: non-english -- https://master.php.net/note/delete/86103/non-english
Del: in docs -- https://master.php.net/note/delete/86103/in+docs
Del: other reasons-- https://master.php.net/note/delete/86103
Reject -- https://master.php.net/note/reject/86103
Search -- https://master.php.net/manage/user-notes.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.