php技巧, PHP解压缩
后端开发-php教程
使用 TbsZip 对 Zip 压缩文件进行操作全仿 乐外卖 源码,vscode怎么用乱码,ubuntu数学绘图,tomcat的如何关闭,著名爬虫,php获取文件的md5,谷歌seo推广公司郑州,云上的日子网站源码1.1,工程机械网页模板lzw
TbsZip 是一个 PHP 的类用来读写 Zip 压缩文件包,该类无需 PHP 扩展或者是临时文件。易语言qq晒密软件源码,vscode上下文插件,ubuntu调整dock,宝塔反向代理tomcat,爬虫建镜像,php分割上传,大丰区seo优化哪个好,网站新闻插件代码,微信三级分销模板怎么使用lzw
TbsZip 可以对压缩文档中的文件进行读、写、修改和删除操作。js木马源码,vscode全屏模式怎么关闭,ubuntu 不能中文,tomcat7调优,sqlite 模式,扁平化服装网页设计,政府构建大型数据库,服务器防御20g,手机照相时间显示插件,前端先学三剑客还是框架,教皇爬虫,paypal php,重庆seo外包公司,异步导出springboot,dede 中标题标签元素,好的源码网站,网页多视频切换代码,国外metro风格网站模板,wdcp后台地址,js 等待加载页面,新闻管理系统asp,视频网站程序模板lzw
/* Some code examples for TbsZipSkrol29, 2010-09-03*/include_once('tbszip.php'); // load the TbsZip library$zip = new clsTbsZip(); // create a new instance of the TbsZip class$zip->CreateNew(); // start a new empty archive for adding files// or$zip->Open('an_existing_archive.zip'); // open an existing archive for reading and/or modifying// --------------------------------------------------// Reading information and data in the opened archive// --------------------------------------------------// check if a file is existing in the archive, the name must precise subfolders if any$ok = $zip->FileExists('subfolder/help.html');// count the files stored in the archive$file_nbr = count($zip->CdFileLst);// retrieve the content of an compressed file in the archive$text1 = $zip->FileRead('readme.txt');// retrieve the content of an compressed file in a subfolder of the archive$text2 = $zip->FileRead('subfolder/readme.txt');if ($ok) $zip->FileExists('subfolder/help.html');// -----------------------------// Modifying data in the archive// -----------------------------// add a file in the archive$zip->FileAdd('newfile.txt', $data, TBSZIP_STRING); // add the file by giving the content$zip->FileAdd('newpic1.jpg', './images/localpic1.jpg', TBSZIP_FILE); // add the file by copying a local file$zip->FileAdd('newpic2.jpg', './images/localpic2.jpg', TBSZIP_FILE, false); // add the uncompressed file by copying a local file// delete an existing file in the archive$zip->FileReplace('newfile.txt', $data, TBSZIP_STRING); // replace the file by giving the content$zip->FileReplace('newpic1.jpg', './images/localpic1.jpg', TBSZIP_FILE); // replace the file by copying a local file$zip->FileReplace('newpic2.jpg', './images/localpic2.jpg', TBSZIP_FILE, false); // replace the uncompressed file by copying a local file$zip->FileReplace('newpic3.jpg', false); // delete the file in the archive// cancel the last modification on the file (add/replace/delete)$zip->FileCancelModif('newpic2.jpg');// ----------------------// Applying modifications// ----------------------$zip->Flush(TBSZIP_FILE, './save/new_archive.zip'); // apply modifications as a new local file// apply modifications as an HTTP downloaded file$zip->Flush(TBSZIP_DOWNLOAD, 'download.zip');$zip->Flush(TBSZIP_DOWNLOAD, 'download.zip', 'application/zip'); // with a specific Content-Type// apply modifications as a downloaded file with your customized HTTP headersheader("Content-type: application/force-download");header("Content-Disposition: attachment; filename=download.zip");header("Expires: Fri, 01 Jan 2010 05:00:00 GMT");$zip->Flush(TBSZIP_DOWNLOAD+TBSZIP_NOHEADER);// -----------------// Close the archive// -----------------$zip->Close(); // stop to work with the opened archive. Modifications are not applied to the opened archive, use Flush() to commit