note 100407 modified in function.rar-extract by danbrown
| From: | danbrown@php.net | Date: | Thu, 14 Oct 2010 16:30:47 +0000 |
| Subject: | note 100407 modified in function.rar-extract by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-173218@lists.php.net to get a copy of this message | ||
Actually the name field in RarEntry are private, you must use the getter, the result code for
extract all content in a rar file is like this
<?php
$rar_file = rar_open($compresed_file);
$list = rar_list($rar_file);
foreach ($list as $file) {
$entry = rar_entry_get($rar_file, $file->getName());
$entry->extract($dest);
}
rar_close($rar_file);
?>
--was--
Actually the name field in RarEntry are private, you must use the getter, the result code for
extract all content in a rar file is like this
$rar_file = rar_open($compresed_file);
$list = rar_list($rar_file);
foreach ($list as $file) {
$entry = rar_entry_get($rar_file, $file->getName());
$entry->extract($dest);
}
rar_close($rar_file);
http://php.net/manual/en/function.rar-extract.php