Tag Archives: zip

zip_read()

It reads the next entry in a ZIP file

Example

<?php
$zp = zip_open(“test.zip”);
while ($zipEntry = zip_read($zp)){
echo “Actuall file name -” . zip_entry_name($zipEntry);
if (zip_entry_open($zp, $zipEntry)){
zip_entry_close($zipEntry);
}
}
zip_close($zp);
?>

zip_entry_read()

It reads from an open entry in the ZIP file

Example

<?php
$zp = zip_open(“test.zip”);
while ($zipEntry = zip_read($zp)){
echo “Actuall file name -” . zip_entry_name($zipEntry);
if (zip_entry_open($zp, $zipEntry)){
zip_entry_close($zipEntry);
}
}
zip_close($zp);
?>

Output

Actuall file name -test.php

zip_entry_open()

It opens an entry in the ZIP file for reading

Example

<?php
$zp = zip_open(“test.zip”);
while ($zipEntry = zip_read($zp)){
echo “Actuall file name -” . zip_entry_name($zipEntry);
if (zip_entry_open($zp, $zipEntry)){
zip_entry_close($zipEntry);
}
}
zip_close($zp);
?>


zip_entry_name()

It returns the name of an entry in the ZIP file

Example

<?php
$zp = zip_open(“test.zip”);
while ($zipEntry = zip_read($zp)){
echo “Actuall file name -” . zip_entry_name($zipEntry);
if (zip_entry_open($zp, $zipEntry)){
zip_entry_close($zipEntry);
}
}
zip_close($zp);
?>

Output

Actuall file name -test.php