Solved

Read txt File From Within Zip Using PHP

Posted on 2011-03-22
2
287 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 50 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This article discusses how to create an extensible mechanism for linked drop downs.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.

707 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