RarArchive::close
PHP function
Edit on GitHub ✎
(PECL rar >= 2.0.0)
Close RAR archive and free all resources
Description
Oop (method):
RarArchive::close(): bool
Procedural:
rar_close(RarArchive $rarfile): bool
Close RAR archive and free all allocated resources.
Parameters
rarfileA
RarArchiveobject, opened withrar_open().
Return Values
Success
Changelog
| Version | Description |
|---|---|
| PECL rar 2.0.0 | The RAR entries returned by RarArchive::getEntry and RarArchive::getEntries are now invalidated when calling this method. This means that all instance methods called for such entries and not guaranteed to succeed. |
Examples
Oop
php
<?php
$rar_arch = RarArchive::open('latest_winrar.rar');
echo $rar_arch."\n";
$rar_arch->close();
echo $rar_arch."\n";
?>The above example will output something similar to:
output
RAR Archive "D:\php_rar\trunk\tests\latest_winrar.rar"
RAR Archive "D:\php_rar\trunk\tests\latest_winrar.rar" (closed)Procedural
php
<?php
$rar_arch = rar_open('latest_winrar.rar');
echo $rar_arch."\n";
rar_close($rar_arch);
echo $rar_arch."\n";
?>