[英]how i can open a file in zip file without extract it by the PHP
我只想制作一个可以打开zip存档中的文件的系统,就像我在该file.text中拥有archive.zip一样。我想要创建一个类来使此页面成为zip.php?archiver = archive.zip&file = file.text我想要此页面向我显示file.text内容有什么想法吗?
From the PHP manual: ZipArchive::getFromName() . 从PHP手册中: ZipArchive :: getFromName() 。 This is exactly what you need.
这正是您所需要的。
<?php
$z = new ZipArchive();
if ($z->open(dirname(__FILE__) . '/test_im.zip')) {
$string = $z->getFromName("mytext.txt");
echo $string;
}
?>
Best wishes, 最好的祝愿,
Fabian 法比安
you could probably do this: 您可能可以这样做:
http://www.php.net/manual/en/function.ziparchive-getfromname.php http://www.php.net/manual/zh/function.ziparchive-getfromname.php
it's a function in http://php.net/manual/en/book.zip.php 这是http://php.net/manual/zh/book.zip.php中的功能
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.