Наш чат в Telegram для обмена идеями, проектами, мыслями, людьми в сфере ИТ г.Ростова-на-Дону: @it_rostov



(PECL rar >= 2.0.0)

RarArchive::open -- rar_open — Open RAR archive


Объектно-ориентированный стиль вызова (method):

public static RarArchive RarArchive::open ( string $filename [, string $password = NULL [, callback $volume_callback = NULL ]] )

Процедурный стиль вызова:

RarArchive rar_open ( string $filename [, string $password = NULL [, callback $volume_callback = NULL ]] )

Open specified RAR archive and return RarArchive instance representing it.


If opening a multi-volume archive, the path of the first volume should be passed as the first parameter. Otherwise, not all files will be shown. This is by design.

Список параметров


Path to the Rar archive.


A plain password, if needed to decrypt the headers. It will also be used by default if encrypted files are found. Note that the files may have different passwords in respect to the headers and among them.


A function that receives one parameter – the path of the volume that was not found – and returns a string with the correct path for such volume or NULL if such volume does not exist or is not known. The programmer should ensure the passed function doesn't cause loops as this function is called repeatedly if the path returned in a previous call did not correspond to the needed volume. Specifying this parameter omits the notice that would otherwise be emitted whenever a volume is not found; an implementation that only returns NULL can therefore be used to merely omit such notices.


Prior to version 2.0.0, this function would not handle relative paths correctly. Use realpath() as a workaround.

Возвращаемые значения

Returns the requested RarArchive instance или FALSE в случае возникновения ошибки.

Описание класса rararchive, примеры использования класса rararchive.

Смотрите также:
Описание на ru2.php.net
Описание на php.ru