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);
}
?>
कोड का आउटपुट ज़िप संग्रह की सामग्री पर निर्भर करता है:
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 |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | फ़ाइल के अंत में डेटा पढ़ा या ""। विफलता पर FALSE |
---|---|
पीएचपी संस्करण: | 4.1.0+ |
❮ पीएचपी ज़िप संदर्भ