دالة PHP zip_entry_read ()
مثال
افتح أرشيف ملف مضغوط ، وافتح إدخال الدليل للقراءة ، واقرأ من إدخال الدليل المفتوح:
<?php
$zip = zip_open("test.zip");
if ($zip) {
while ($zip_entry = zip_read($zip)) {
echo "<p>Name: " . zip_entry_name($zip_entry) . "<br>";
// Open directory entry for reading
if (zip_entry_open($zip, $zip_entry)) {
echo "File Contents:<br>";
// Read open directory entry
$contents = zip_entry_read($zip_entry);
echo "$contents<br>";
zip_entry_close($zip_entry);
}
echo "</p>";
}
zip_close($zip);
}
?>
يعتمد إخراج الكود على محتويات أرشيف ZIP:
Name: ziptest.txt
File Contents:
Hello World! This is a test.
Name: htmlziptest.html
File Contents:
Hello World!
This is a test for the zip functions in PHP.
التعريف والاستخدام
تقرأ الوظيفة zip_entry_read () من إدخال دليل مفتوح.
بناء الجملة
zip_entry_read(zip_entry, length)
قيمه المعامل
Parameter | Description |
---|---|
zip_entry | Required. Specifies the directory entry returned by zip_read() |
length | Optional. Specifies the number of (uncompressed) bytes to return. Default is 1024 |
تفاصيل تقنية
قيمة الإرجاع: | قراءة البيانات أو "" في نهاية الملف. خطأ في الفشل |
---|---|
إصدار PHP: | 4.1.0+ |
❮ PHP المرجع البريدي