Solved

Read txt File From Within Zip Using PHP

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
This article discusses how to create an extensible mechanism for linked drop downs.
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

785 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