Current Location: Home> Function Categories> zip_entry_read

zip_entry_read

Read an open project in the ZIP file.
Name:zip_entry_read
Category:Uncategorized
Programming Language:php
One-line Description:Read an open project in the ZIP file.

Definition and usage

The zip_entry_read() function gets the content from the open zip archive project.

If successful, the content of the project is returned. If it fails, false is returned.

实例

<?php
$zip = zip_open("test.zip");

if ($zip)
  {
  while ($zip_entry = zip_read($zip))
    {
    echo "<p>";
    echo "Name: " . zip_entry_name($zip_entry) . "<br />";

    if (zip_entry_open($zip, $zip_entry))
      {
      echo "File Contents:<br/>";
      $contents = zip_entry_read($zip_entry);
      echo "$contents<br />";
      zip_entry_close($zip_entry);
      }
    echo "</p>";
  }

zip_close($zip);

}
?>

grammar

 zip_entry_read ( zip_entry , length )
parameter describe
zip_entry Required. Specifies the zip project resource to be read (zip project opened by zip_read()).
length Optional. Specifies the number of bytes returned. The default is 1024.
Similar Functions
Popular Articles