note 90045 added to function.ziparchive-extractto
| From: | Anonymous at osu1 dot php dot net | Date: | Thu, 02 Apr 2009 21:50:52 +0000 |
| Subject: | note 90045 added to function.ziparchive-extractto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152777@lists.php.net to get a copy of this message | ||
I found it useful to add this to a function.
<?php
/**
* Extracts a ZIP archive to the specified extract path
*
* @param string $file The ZIP archive to extract (including the path)
* @param string $extractPath The path to extract the ZIP archive to
*
* @return boolean TURE if the ZIP archive is successfully extracted, FALSE if there was an errror
*
*/
function zip_extract($file, $extractPath) {
$zip = new ZipArchive;
$res = $zip->open($file);
if ($res === TRUE) {
$zip->extractTo($extractPath);
$zip->close();
return TRUE;
} else {
return FALSE;
}
} // end function
?>
----
Server IP: 69.147.83.197
Probable Submitter: 71.158.242.194
----
Manual Page -- http://www.php.net/manual/en/function.ziparchive-extractto.php
Edit -- https://master.php.net/note/edit/90045
Del: integrated -- https://master.php.net/note/delete/90045/integrated
Del: useless -- https://master.php.net/note/delete/90045/useless
Del: bad code -- https://master.php.net/note/delete/90045/bad+code
Del: spam -- https://master.php.net/note/delete/90045/spam
Del: non-english -- https://master.php.net/note/delete/90045/non-english
Del: in docs -- https://master.php.net/note/delete/90045/in+docs
Del: other reasons-- https://master.php.net/note/delete/90045
Reject -- https://master.php.net/note/reject/90045
Search -- https://master.php.net/manage/user-notes.php