?
Solved

Read txt File From Within Zip Using PHP

Posted on 2011-03-22
2
Medium Priority
?
288 Views
Last Modified: 2012-05-11
Hi

What would be the best approach to reading a specific line from the header of a .txt file that is in a zip file?

Specifically Wordpress .txt, so you'll know the header for that is standard and I'm looking to get the version number but while the .txt file is still in the zip.

Would I simply need to extract that .txt to somewhere on my server?

Thanks
Ryan
0
Comment
Question by:Ryan Bayne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
tsmgeek earned 200 total points
ID: 35194768
Extract the file using the ZIP function in php...

http://uk.php.net/manual/en/function.ziparchive-extractto.php

then read your file into array line by line, check first entry of array for the data you want
0
 
LVL 2

Author Comment

by:Ryan Bayne
ID: 35197597
I thought so. I'll be providing this ability within a Wordpress plugin so wanted to make sure there was not an even shorter method but even if there was a php function for this, it would still just extract that file wouldn't it.

Thans
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to implement server side field validation and display customized error messages to the client.
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question