note 47924 added to ref.zip

From: Date: Mon, 06 Dec 2004 00:06:05 +0000
Subject: note 47924 added to ref.zip
Groups: php.notes 
Request: Send a blank email to php-notes+get-81418@lists.php.net to get a copy of this message
Here is a function if all you need is to unpack an archive: function unpackZip($dir,$file) { $root=$_SERVER['DOCUMENT_ROOT']; if ($zip = zip_open($root.$dir.$file.".zip")) { if ($zip) { mkdir(".".$dir.$file); while ($zip_entry = zip_read($zip)) { if (zip_entry_open($zip,$zip_entry,"r")) { $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); $fp=fopen(".".$dir.$file."/".zip_entry_name($zip_entry),"w"); fwrite($fp,$buf); zip_entry_close($zip_entry); } else return false; } zip_close($zip); } } else return false; return true; } ---- Manual Page -- http://www.php.net/manual/en/ref.zip.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47924 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47924&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47924&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47924&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47924&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47924&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47924&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47924&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81418) next »