RarArchive
PHP Manual

RarArchive::close

rar_close

(PECL rar >= 2.0.0)

RarArchive::close -- rar_closeClose RAR archive and free all resources.

説明

Object oriented style (method):

public bool RarArchive::close ( void )

Procedural style:

bool rar_close ( RarArchive $rarfile )

Close RAR archive and free all allocated resources.

パラメータ

rarfile

A RarArchive object, opened with rar_open().

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

変更履歴

バージョン 説明
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.

例1 Object oriented style

<?php
$rar_arch 
RarArchive::open('latest_winrar.rar');
echo 
$rar_arch."\n";
$rar_arch->close();
echo 
$rar_arch."\n";
?>

上の例の出力は、 たとえば以下のようになります。

RAR Archive "D:\php_rar\trunk\tests\latest_winrar.rar"
RAR Archive "D:\php_rar\trunk\tests\latest_winrar.rar" (closed)

例2 Procedural style

<?php
$rar_arch 
rar_open('latest_winrar.rar');
echo 
$rar_arch."\n";
rar_close($rar_arch);
echo 
$rar_arch."\n";
?>


RarArchive
PHP Manual