RarArchive::close

rar_close

(PECL rar >= 2.0.0)

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

說明

面向?qū)ο箫L(fēng)格 (method):

public RarArchive::close(): bool

過程化風(fēng)格:

rar_close(RarArchive $rarfile): bool

Close RAR archive and free all allocated resources.

參數(shù)

rarfile

A RarArchive object, opened with rar_open().

返回值

成功時(shí)返回 true, 或者在失敗時(shí)返回 false。

更新日志

版本 說明
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.

范例

示例 #1 面向?qū)ο箫L(fēng)格

<?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 過程化風(fēng)格

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