Web студия "GrandView"
  Главная   Написать Контакты
   
   
О проекте
Руководство php
 

zip_read

(PHP 4 >= 4.1.0, PECL)

zip_read -- Read next entry in a ZIP file archive

Описание

mixed zip_read ( resource zip [, int flags] )

Reads the next entry in a zip file archive.

Список параметров

zip

A ZIP file previously opened with zip_open().

flags

Bitmask of ZIP constants.

Возвращаемые значения

Returns a directory entry resource for later use with the zip_entry_... functions or FALSE if there's no more entries to read or number of error in case of other error.



add a note add a note User Contributed Notes
zip_read
nico at nicoswd dot com
29-Sep-2007 01:29
If you get an error like this:

Warning: zip_read() expects parameter 1 to be resource, integer given in xxxxxx on line x

It's because zip_open() failed to open the file and returned an error code instead of a resource. It took me a while to figure out why it failed to open the file, until I tried to use the FULL path to the file.

<?php

// Even if the file exists, zip_open() will return an error code.
$file = 'file.zip';
$zip = zip_open($file);

// The workaround:
$file = getcwd() . '/file.zip';

// Or:
$file = 'C:\\path\\to\\file.zip';

?>

This worked for me on Windows at least. I'm not sure about other platforms.

ZipArchive::addFile> <zip_open
Last updated: Fri, 26 Jan 2007
 
 
Новости
11 июля 2007
Сайт запущен
© 2007 info@grandviewstudio.com

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 324

Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/sites/grandviewstudiocom/www/65f67d67a94ad980786580ae69e11c07/sape.php on line 330
Z058440144362 Z348613067571