文字

RarArchive::close

rar_close

(PECL rar >= 2.0.0)

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

说明

面向对象风格 (method):

public bool RarArchive::close ( void )

过程化风格:

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.

范例

Example #1 面向对象风格

<?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)

Example #2 过程化风格

<?php
$rar_arch 
rar_open ( 'latest_winrar.rar' );
echo 
$rar_arch . "\n" ;
rar_close ( $rar_arch );
echo 
$rar_arch . "\n" ;
?>
上一篇: 下一篇: