日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区

您的位置:首頁技術(shù)文章
文章詳情頁

PHP擴展之壓縮與歸檔擴展3——Zip

瀏覽:173日期:2022-09-15 15:14:44

此擴展可以讓你透明地讀寫ZIP壓縮文檔以及它們里面的文件。

在PHP5.2以后,為了使用這些函數(shù),必須在編譯 PHP 時用?--enable-zip?配置選項來提供 zip 支持。

Example #1 創(chuàng)建一個 Zip 歸檔

<?php $zip = new ZipArchive(); $filename = './test112.zip'; if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {exit('cannot open <$filename>n'); } $zip->addFromString('testfilephp.txt' . time(), '#1 This is a test string added as testfilephp.txt.n'); $zip->addFromString('testfilephp2.txt' . time(), '#2 This is a test string added as testfilephp2.txt.n'); $zip->addFile($thisdir . '/too.php','/testfromfile.php'); echo 'numfiles: ' . $zip->numFiles . 'n'; echo 'status:' . $zip->status . 'n'; $zip->close();?>

Example #2 輸出文檔細(xì)節(jié)和列表

<?php $za = new ZipArchive(); $za->open(’test_with_comment.zip’); print_r($za); var_dump($za); echo 'numFiles: ' . $za->numFiles . 'n'; echo 'status: ' . $za->status . 'n'; echo 'statusSys: ' . $za->statusSys . 'n'; echo 'filename: ' . $za->filename . 'n'; echo 'comment: ' . $za->comment . 'n'; for ($i=0; $i<$za->numFiles;$i++) {echo 'index: $in';print_r($za->statIndex($i)); } echo 'numFile:' . $za->numFiles . 'n';?>

Example #3 Zip 流封裝,讀取一個 OpenOffice 文件的元信息

<?php $reader = new XMLReader(); $reader->open(’zip://’ . dirname(__FILE__) . ’/test.odt#meta.xml’); $odt_meta = array(); while ($reader->read()) {if ($reader->nodeType == XMLREADER::ELEMENT) { $elm = $reader->name;} else { if ($reader->nodeType == XMLREADER::END_ELEMENT && $reader->name == ’office:meta’) {break; } if (!trim($reader->value)) {continue; } $odt_meta[$elm] = $reader->value;} } print_r($odt_meta);?>

此例使用了舊的 API(PHP 4),它打開了一個 ZIP 文件歸檔,讀取歸檔里的每個文件,并輸出文件內(nèi)容。此例用到的?test2.zip?文檔是 ZZIPlib 源分布里測試文檔中的一個。

Example #4 Zip 使用范例

<?php $zip = zip_open('/tmp/test2.zip'); if ($zip) {while ($zip_entry = zip_read($zip)) { echo 'Name: ' . zip_entry_name($zip_entry) . 'n'; echo 'Actual Filesize: ' . zip_entry_filesize($zip_entry) . 'n'; echo 'Compressed Size: ' . zip_entry_compressedsize($zip_entry) . 'n'; echo 'Compression Method: ' . zip_entry_compressionmethod($zip_entry) . 'n'; if (zip_entry_open($zip, $zip_entry, 'r')) { echo 'File Contents:n'; $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); echo '$bufn'; zip_entry_close($zip_entry); } echo 'n';}zip_close($zip); }?>

?ZipArchive 類

ZipArchive::addEmptyDir?— Add a new directoryZipArchive::addFile?— Adds a file to a ZIP archive from the given pathZipArchive::addFromString?— Add a file to a ZIP archive using its contentsZipArchive::addGlob?— Add files from a directory by glob patternZipArchive::addPattern?— Add files from a directory by PCRE patternZipArchive::close?— Close the active archive (opened or newly created)ZipArchive::deleteIndex?— delete an entry in the archive using its indexZipArchive::deleteName?— delete an entry in the archive using its nameZipArchive::extractTo?— Extract the archive contentsZipArchive::getArchiveComment?— Returns the Zip archive commentZipArchive::getCommentIndex?— Returns the comment of an entry using the entry indexZipArchive::getCommentName?— Returns the comment of an entry using the entry nameZipArchive::getFromIndex?— Returns the entry contents using its indexZipArchive::getFromName?— Returns the entry contents using its nameZipArchive::getNameIndex?— Returns the name of an entry using its indexZipArchive::getStatusString?— Returns the status error message, system and/or zip messagesZipArchive::getStream?— Get a file handler to the entry defined by its name (read only).ZipArchive::locateName?— Returns the index of the entry in the archiveZipArchive::open?— Open a ZIP file archiveZipArchive::renameIndex?— Renames an entry defined by its indexZipArchive::renameName?— Renames an entry defined by its nameZipArchive::setArchiveComment?— Set the comment of a ZIP archiveZipArchive::setCommentIndex?— Set the comment of an entry defined by its indexZipArchive::setCommentName?— Set the comment of an entry defined by its nameZipArchive::statIndex?— Get the details of an entry defined by its index.ZipArchive::statName?— Get the details of an entry defined by its name.ZipArchive::unchangeAll?— Undo all changes done in the archiveZipArchive::unchangeArchive?— Revert all global changes done in the archive.ZipArchive::unchangeIndex?— Revert all changes done to an entry at the given indexZipArchive::unchangeName?— Revert all changes done to an entry with the given name.

相關(guān)函數(shù)

zip_close?— Close a ZIP file archivezip_entry_close?— Close a directory entryzip_entry_compressedsize?— Retrieve the compressed size of a directory entryzip_entry_compressionmethod?— Retrieve the compression method of a directory entryzip_entry_filesize?— Retrieve the actual file size of a directory entryzip_entry_name?— Retrieve the name of a directory entryzip_entry_open?— Open a directory entry for readingzip_entry_read?— Read from an open directory entryzip_open?— Open a ZIP file archivezip_read?— Read next entry in a ZIP file archive
標(biāo)簽: PHP
相關(guān)文章:
日本不卡不码高清免费观看,久久国产精品久久w女人spa,黄色aa久久,三上悠亚国产精品一区二区三区
日本麻豆一区二区三区视频| 国产亚洲字幕| 美女毛片一区二区三区四区最新中文字幕亚洲 | 国产白浆在线免费观看| 夜夜精品视频| 国产视频一区二| 97精品国产一区二区三区| 亚洲一级网站| 成人免费一区| 国产乱人伦丫前精品视频| 婷婷激情一区| 精品一区91| 男人操女人的视频在线观看欧美| 97精品国产一区二区三区 | 日韩欧美激情| 久久久亚洲一区| 欧美成人基地| 日韩精品麻豆| 人人香蕉久久| 91精品亚洲| 亚洲成人免费| 精品国产乱码| 三级一区在线视频先锋| 在线日韩欧美| 国产aa精品| 日本欧美韩国一区三区| 香蕉精品久久| 久久99青青| 激情综合婷婷| 日韩不卡一二三区| 97成人超碰| 欧美aⅴ一区二区三区视频| 亚洲一区区二区| 免播放器亚洲一区| 性欧美xxxx免费岛国不卡电影| 少妇精品导航| 免费人成在线不卡| 91精品国产成人观看| 美女精品久久| 高清av不卡| 国产v综合v| 美女国产精品久久久| 日本精品在线播放| 亚洲欧美一级| 日韩在线观看一区二区| 蜜臀久久99精品久久久久宅男 | 久久久久亚洲| 久久亚洲视频| 蜜臀精品久久久久久蜜臀 | 日韩美女精品| 麻豆精品新av中文字幕| 国产一卡不卡| 国产精品毛片久久久| 久久亚洲人体| 亚洲激情二区| 欧美亚洲三级| 国产伦精品一区二区三区视频 | 九九久久国产| 国产精品久久乐| 999久久久91| 久久av资源| 99久久激情| 国产一区二区三区自拍| 国产精品tv| 亚洲午夜久久| 国产精品v亚洲精品v日韩精品 | 欧美aa一级| 欧美一区三区| 亚洲人成高清| 日韩av一级| 国产在线日韩精品| 亚洲精品乱码| 亚洲综合不卡| 久久精品国产久精国产爱| 日韩综合一区| 嫩草伊人久久精品少妇av杨幂 | 亚洲国产日韩欧美在线| 精品免费av| 国产精品7m凸凹视频分类| 亚洲影视一区二区三区| 亚洲精品午夜av福利久久蜜桃| 亚洲69av| 美女日韩在线中文字幕| 999国产精品视频| 久久国产免费| 欧美羞羞视频| 久久理论电影| 国产精品久久乐| 免费看的黄色欧美网站| 久久国产亚洲精品| 在线亚洲人成| 欧美啪啪一区| 99综合视频| 国产亚洲网站| 亚洲免费一区二区| 免费日韩av片| 欧美日韩国产高清电影| 麻豆久久久久久| 国产精品porn| 久久久国产精品网站| 日韩精品三级| 视频一区国产视频| 激情综合激情| 中文字幕在线免费观看视频| 日本一区二区三区视频在线看| 欧美丝袜一区| japanese国产精品| jizzjizz中国精品麻豆| 国产亚洲观看| 日韩欧美2区| 日本亚洲欧美天堂免费| 亚洲经典在线| 国产一区日韩一区| 国产精品91一区二区三区| 日本精品在线中文字幕| 久久精品卡一| 日韩高清一区| 999精品色在线播放| 视频一区日韩| 蜜桃av.网站在线观看| 三级在线观看一区二区| 亚洲一区有码| 最新中文字幕在线播放 | 婷婷视频一区二区三区| 最新国产拍偷乱拍精品| 日本欧美韩国一区三区| 青青国产精品| 精品中文字幕一区二区三区av| 国产精品嫩草99av在线| jiujiure精品视频播放| 9国产精品视频| 日本一区二区免费高清| 亚洲精品99| 国产精品99久久免费| 国产资源在线观看入口av| 999国产精品999久久久久久| 国产精品theporn| 91看片一区| 亚洲激情国产| 欧美一级精品| 欧洲av一区二区| 国模精品一区| 免费观看在线综合色| 久久视频一区| 日韩一区欧美| 日韩精品免费一区二区三区| 日产精品一区二区| 国产精品一级在线观看| 97精品久久| 国产精品极品| 丝瓜av网站精品一区二区| 欧美黄页在线免费观看| 国产亚洲精品精品国产亚洲综合| 丝袜美腿诱惑一区二区三区| 国产精品美女久久久久久不卡| 日韩精品免费视频一区二区三区| 丝袜美腿成人在线| 午夜影院一区| 欧美日一区二区三区在线观看国产免| 色老板在线视频一区二区| 亚洲色图网站| 国产一区亚洲| 首页国产精品| 中文字幕在线免费观看视频| 国产欧美日韩精品高清二区综合区| 国产一级久久| 日本在线一区二区三区| 久久午夜视频| 香蕉国产精品| 亚洲欧洲av| 精品亚洲二区| 久久精品卡一| 亚洲欧美久久精品| 久久av导航| 好看不卡的中文字幕| 日韩三区免费| 视频一区在线播放| 亚洲神马久久| 欧美日韩一区二区国产| 日本午夜精品久久久久| 里番精品3d一二三区| 免费亚洲婷婷| 麻豆免费精品视频| 久久精品国产精品亚洲毛片| 91精品丝袜国产高跟在线| 精品国产一区二区三区av片| 午夜欧美在线| 免费在线成人| 中文字幕av亚洲精品一部二部| 中文字幕亚洲精品乱码| 精品国产一区二区三区2021| 中文字幕在线视频网站| 在线日韩电影| 亚洲一区二区三区免费在线观看 | 9国产精品视频| 欧美特黄一级| 久久福利影视| 国产精品xx| 日韩激情综合| 在线人成日本视频|