PHP zip_entry_read() လုပ်ဆောင်ချက်
ဥပမာ
ZIP ဖိုင်မှတ်တမ်းကို ဖွင့်ပါ၊ ဖတ်ရန်အတွက် ဖွင့်ထားသော လမ်းညွှန်ဖိုင်ကို ဖွင့်ပါ၊ နှင့် ဖွင့်ထားသော လမ်းညွှန်ထည့်သွင်းမှုမှ ဖတ်ပါ-
<?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 |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | ဖိုင်၏အဆုံးတွင် ဒေတာဖတ်ခြင်း သို့မဟုတ် ""။ ရှုံးနိမ့်မှုအပေါ် မှားသည်။ |
---|---|
PHP ဗားရှင်း- | 4.1.0+ |
❮ PHP Zip အကိုးအကား