note 106688 added to rarentry.extract
| From: | Anonymous at osu1 dot php dot net | Date: | Mon, 28 Nov 2011 19:18:53 +0000 |
| Subject: | note 106688 added to rarentry.extract | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184743@lists.php.net to get a copy of this message | ||
Of course, mixing procedural and object oriented style is bad practice, so a better example to
extract all files is:
<?php
/* example by somebody who does know how to code */
$filename = 'foobar.rar';
$filepath = '/home/foo/bar/';
$rar_file = RarArchive::open($filepath.$filename);
foreach($rar_file->getEntries() as $entry)
{
$entry->extract(''); // extract to the current dir
}
$rar_file->close();
?>
----
Server IP: 83.137.20.135
Probable Submitter: 130.89.167.48
----
Manual Page -- http://www.php.net/manual/en/rarentry.extract.php
Edit -- https://master.php.net/note/edit/106688
Del: integrated -- https://master.php.net/note/delete/106688/integrated
Del: useless -- https://master.php.net/note/delete/106688/useless
Del: bad code -- https://master.php.net/note/delete/106688/bad+code
Del: spam -- https://master.php.net/note/delete/106688/spam
Del: non-english -- https://master.php.net/note/delete/106688/non-english
Del: in docs -- https://master.php.net/note/delete/106688/in+docs
Del: other reasons-- https://master.php.net/note/delete/106688
Reject -- https://master.php.net/note/reject/106688
Search -- https://master.php.net/manage/user-notes.php