W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
(PECL rar >= 0.1)
RarEntry::getName — 獲取條目的名稱
public RarEntry::getName(): string
返回存檔條目的名稱(帶路徑)。
此函數(shù)沒有參數(shù)。
以字符串形式返回條目名稱,如果 出錯則返回 false。
版本 | 說明 |
---|---|
PECL rar 2.0.0 | 從版本 2.0.0 開始,返回的字符串以 Unicode/UTF-8 編碼。 |
示例 #1 RarEntry::getName() example
<?php
//this example is safe even in pages not encoded in UTF-8
//for those encoded in UTF-8, the call to mb_convert_encoding is unnecessary
$rar_file = rar_open('example.rar') or die("Failed to open Rar archive");
$entry = rar_entry_get($rar_file, 'Dir/file.txt') or die("Failed to find such entry");
echo "Entry name: " . mb_convert_encoding(
htmlentities(
$entry->getName(),
ENT_COMPAT,
"UTF-8"
),
"HTML-ENTITIES",
"UTF-8"
);
?>
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: