Solved

Read txt File From Within Zip Using PHP

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
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…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

726 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