
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
zip_read() function in PHP
The zip_read() function reads the next entry in a ZIP file archive.
Syntax
zip_read(zip)
Parameters
zip − The zip resource to read
Return
The zip_read() function returns a resource containing a file within the zip archive on success.
Example
The following is an example, wherein we have a zip file "new.zip", with the following files.
amit.txt peter.txt result.html demo.java settings.ini
Example
Let us now see the 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); } ?>
Output
File Name = amit.txt File Name = peter.txt File Name = result.html File Name = demo.java File Name = settings.ini
Advertisements