You are here: Un-zipping file problem « All PHP « IT news, forums, messages
Un-zipping file problem

Posted by Brian on 08/04/06 22:12

Hi all

Below is a bit of code that opens up and reads a
zip file.

I'm having trouble working out how to read in line
by line. The file I am unzipping is a CSV file and I
need to return each line so I can work on them

Any help would be great

Brian

$zip = zip_open("$filepath"); // << full path of the file
if ($zip) {
while ($zip_entry = zip_read($zip)) {
if (zip_entry_open($zip, $zip_entry, "r")) {
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
print "$buf<br>\n"; // << what to return each line so i can work
on it
zip_entry_close($zip_entry);
}
echo "<br>\n";
}
zip_close($zip);
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация