- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to read a single file inside a zip archive with PHP
To read a single fine inside z zip archive, the code is as follows −
$handle = fopen('zip://test.zip#test.txt', 'r'); $result = ''; while (!feof($handle)) { $result .= fread($handle, 8192); } fclose($handle); echo $result;
The output will be the contents of the zip file.
- Related Articles
- How to create a zip archive of a directory using Python?
- How to Zip a directory in PHP?
- How to read all files in a folder to a single file using Java?
- How to create a zip file using Python?
- How to read a text file with C++?
- How are files added to a zip file using Python?
- How to read a .txt file with RandomAccessFile in Java?
- How to read a text file in Selenium with python?
- How to read a Pandas CSV file with no header?
- How to create a zip file and ignore directory structure in Linux?
- How to read text file into a list or array with Python?
- How to open a file in read and write mode with Python?
- How to read only the first line of a file with Python?
- How to read a text file in Python?
- Read last line from file in PHP

Advertisements