PHP zip_entry_compressedsize()ฟังก์ชัน
ตัวอย่าง
เปิดไฟล์ ZIP และรับชื่อและขนาดที่บีบอัดของรายการไดเร็กทอรี:
<?php
$zip = zip_open("test.zip");
if ($zip) {
while ($zip_entry = zip_read($zip)) {
echo "<p>";
// Get name
of directory entry
echo "Name: " . zip_entry_name($zip_entry) . "<br>";
// Get
compressed size
echo "Compressed size: " . zip_entry_compressedsize($zip_entry);
echo "</p>";
}
zip_close($zip);
}
?>
ผลลัพธ์ของรหัสขึ้นอยู่กับเนื้อหาของไฟล์ ZIP:
Name: ziptest.txt
Compressed
size: 56
Name: htmlziptest.html
Compressed
size: 101
ความหมายและการใช้งาน
ฟังก์ชัน zip_entry_compressedsize() จะคืนค่าขนาดไฟล์ที่บีบอัดของรายการไดเรกทอรี ZIP
ไวยากรณ์
zip_entry_compressedsize(zip_entry)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
zip_entry | Required. Specifies the ZIP directory entry returned by zip_read() |
รายละเอียดทางเทคนิค
คืนมูลค่า: | ขนาดที่บีบอัด |
---|---|
รุ่น PHP: | 4.1.0+ |
❮ PHP Zip อ้างอิง