PHP zip_entry_name()関数
例
ZIPファイルアーカイブを開き、ディレクトリエントリの名前を取得します。
<?php
$zip = zip_open("test.zip");
if ($zip) {
while ($zip_entry = zip_read($zip)) {
// Get name
of directory entry
echo "Name: " . zip_entry_name($zip_entry) . "<br>";
}
zip_close($zip);
}
?>
コードの出力は、ZIPアーカイブの内容によって異なります。
Name: ziptest.txt
Name: htmlziptest.html
定義と使用法
zip_entry_name()関数は、ZIPディレクトリエントリの名前を返します。
構文
zip_entry_name(zip_entry)
パラメータ値
Parameter | Description |
---|---|
zip_entry | Required. Specifies the zip directory entry returned by zip_read() |
技術的な詳細
戻り値: | ディレクトリエントリの名前 |
---|---|
PHPバージョン: | 4.1.0+ |
❮PHPZipリファレンス