2024 日本 PHP 研討會

RarArchive::getComment

rar_comment_get

(PECL rar >= 2.0.0)

RarArchive::getComment -- rar_comment_get從 RAR 封存檔取得註釋文字

說明

物件導向風格 (方法)

public RarArchive::getComment(): 字串

程序式風格

rar_comment_get(RarArchive $rarfile): 字串

取得儲存在 RAR 壓縮檔中的(全域)註解。其長度最多可達 64 KiB。

注意事項:

此擴充功能不支援項目層級的註解。

參數

rarfile

一個 RarArchive 物件,使用 rar_open() 開啟。

回傳值

回傳註解,如果沒有則回傳 null

注意事項:

RAR 目前不支援 Unicode 註解。此函數結果的編碼未指定,但很可能是 Windows-1252。

範例

範例 #1 物件導向風格

<?php
$rar_arch
= RarArchive::open('commented.rar');
echo
$rar_arch->getComment();
?>

上述範例將輸出類似以下內容

This is the comment of the file commented.rar.

範例 #2 程序式風格

<?php
$rar_arch
= rar_open('commented.rar');
echo
rar_comment_get($rar_arch);
?>

新增註記

使用者貢獻的註記

此頁面沒有使用者貢獻的註記。
To Top