note 86103 added to function.ziparchive-extractto
| From: | Kaya at osu1 dot php dot net | Date: | Fri, 03 Oct 2008 08:36:01 +0000 |
| Subject: | note 86103 added to function.ziparchive-extractto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145010@lists.php.net to get a copy of this message | ||
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