Archive

Posts Tagged ‘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);
?>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: , ,

zip_open()

It opens a ZIP file

Example

<?php
$zp = zip_open(“test.zip”);
zip_close($zp);
?>

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: , ,

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

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: , ,

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);
?>


EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: , ,

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

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: , ,

zip_entry_filesize()

It returns the actual file size of an entry in the ZIP file

Example

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

Output

Actaull file size -136

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: , ,

zip_entry_compressionmethod()

It returns the compression method of a directory entry

Example

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

Output

Compression Method -deflated

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: , ,

zip_entry_compressedsize()

It returns the compressed size of a directory entry

Example

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

Output

File size -103

EmailFacebookLinkedInMySpaceDiggTumblrStumbleUponShare
Categories: PHP Tags: , ,

Switch to our mobile site