ฟังก์ชัน zip_entry_open() ใช้สำหรับเปิดรายการในอาร์คีฟ ZIP เพื่ออ่าน
รูปแบบการใช้งาน (Syntax)
zip_entry_open(zip_file, zip_entry, mode)
พารามิเตอร์ (Parameters)
zip_file − ไฟล์ ZIP ที่จะอ่าน
zip_entry − รายการ ZIP ที่ต้องการเปิด
mode − ประเภทการเข้าถึงที่ต้องการสำหรับอาร์คีฟ ZIP
ค่าที่ส่งกลับ (Return Value)
ฟังก์ชัน zip_entry_open() ส่งคืน TRUE เมื่อสำเร็จ หรือ FALSE เมื่อล้มเหลว
ตัวอย่างการใช้งาน
<?php
$zip_file = zip_open("new.zip");
$zip_entry = zip_read($zip_file);
zip_entry_open($zip_file, $zip_entry, "rb");
$myfile = zip_entry_name($zip_entry);
if ($myfile == true)
echo("Zip file: " . $file . " is opened now!<br>");
$flag = zip_entry_close($zip_entry);
if ($flag == true)
echo($file . " closed!");
zip_close($zip_file);
?>
ผลลัพธ์ (Output)
new/one is opened now! new/one closed!