zip_read() function reads the next entry in a ZIP file archive.
zip_read(zip)
zip − The zip resource to be read
The zip_read() function returns the resource containing the file in the zip archive on success.
The following is an example where we have a zip file named "new.zip" and contains the following files.
amit.txt peter.txt result.html demo.java settings.ini
Now let’s look at an example:
<?php $zip = zip_open("new.zip"); if ($zip) { while ($zip_entry = zip_read($zip)) { echo "File Name = ". zip_entry_filename($zip_entry). "<br/>"; } zip_close($zip); } ?>
File Name = amit.txt File Name = peter.txt File Name = result.html File Name = demo.java File Name = settings.ini
The above is the detailed content of In PHP, zip_read() function. For more information, please follow other related articles on the PHP Chinese website!