PHP zip_entry_open () फ़ंक्शन
उदाहरण
एक ज़िप फ़ाइल संग्रह खोलें, पढ़ने के लिए निर्देशिका प्रविष्टि खोलें, और खुली निर्देशिका प्रविष्टि से पढ़ें:
<?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_open() फ़ंक्शन पढ़ने के लिए ज़िप फ़ाइल में एक निर्देशिका प्रविष्टि खोलता है।
वाक्य - विन्यास
zip_entry_open(zip, zip_entry, mode)
पैरामीटर मान
Parameter | Description |
---|---|
zip | Required. Specifies the ZIP resource opened with zip_open() |
zip_entry | Required. Specifies the ZIP directory entry to open (opened with zip_read()) |
mode | Optional. Specifies the type of access you require to the ZIP archive. Note: Currently, mode is always "rb", because ZIP support in PHP is read only |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | सफलता पर सच। विफलता पर FALSE |
---|---|
पीएचपी संस्करण: | 4.1.0+ |
❮ पीएचपी ज़िप संदर्भ