PHP8 RarArchive::getComment

2024-02-23 11:45 更新

rar_comment_get

(PECL rar >= 2.0.0)

RarArchive::getComment -- rar_comment_get — 從 RAR 存檔中獲取注釋文本

說明 

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

public RarArchive::getComment(): string

過程化風(fēng)格:

rar_comment_get(RarArchive $rarfile): string

獲取存儲(chǔ)在 RAR 存檔中的(全局)注釋。它的長度可能長達(dá) 64 KiB。

注意:此擴(kuò)展不支持入門級的注釋。

參數(shù) 

rarfile

一個(gè) RarArchive 對象,用 rar_open() 打開。

返回值 

如果沒有,則返回注釋或 null。

注意:RAR 目前不支持 unicode 注釋。的編碼 未指定此函數(shù)的結(jié)果,但可能會(huì)指定 視窗 1252。

示例 

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

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

以上示例的輸出類似于:

This is the comment of the file commented.rar.

示例 #2 過程化風(fēng)格

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


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號