(PECL rar >= 2.0.0)
RarArchive::close -- rar_close — Close RAR archive and free all resources
Object oriented style (method):
Procedural style:
Close RAR archive and free all allocated resources.
Gibt bei Erfolg TRUE zurück. Im Fehlerfall wird FALSE zurückgegeben.
Version | Beschreibung |
---|---|
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. |
Beispiel #1 Object oriented style
<?php
$rar_arch = RarArchive::open('latest_winrar.rar');
echo $rar_arch."\n";
$rar_arch->close();
echo $rar_arch."\n";
?>
Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
RAR Archive "D:\php_rar\trunk\tests\latest_winrar.rar" RAR Archive "D:\php_rar\trunk\tests\latest_winrar.rar" (closed)
Beispiel #2 Procedural style
<?php
$rar_arch = rar_open('latest_winrar.rar');
echo $rar_arch."\n";
rar_close($rar_arch);
echo $rar_arch."\n";
?>