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
