PHPのzip_entry_name()関数
定義と使用法
zip_entry_name()関数は、zipファイルの名前を返します。
文法
zip_entry_name(zip_entry)
参数 | 描述 |
---|---|
zip_entry | 必需。规定要读取的 zip 项目资源(由 zip_read() 打开的 zip 项目)。 |
例
<?php
$zip = zip_open("test.zip");
if ($zip)
{
while ($zip_entry = zip_read($zip))
{
echo "Name: " . zip_entry_name($zip_entry) . "<br />";
}
zip_close($zip);
}
?>
$zip = zip_open("test.zip");
if ($zip)
{
while ($zip_entry = zip_read($zip))
{
echo "Name: " . zip_entry_name($zip_entry) . "<br />";
}
zip_close($zip);
}
?>
意志出力上のコード:
Name: ziptest.txt
Name: htmlziptest.html
Name: htmlziptest.html
完全なPHP Zipファイルリファレンス