(PECL rar >= 2.0.0)
RarArchive::getComment -- rar_comment_get — 從 RAR 封存檔取得註釋文字
物件導向風格 (方法)
程序式風格
取得儲存在 RAR 壓縮檔中的(全域)註解。其長度最多可達 64 KiB。
注意事項:
此擴充功能不支援項目層級的註解。
範例 #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);
?>