Use tar.gz file like a folder?

Does PHP have an extension that permits to use a tar.gz like a folder?

I have some file that uses a similar structure and I don't need to extract all to read information about it, so can I make file_get_contents("my/path/to/tar/something.tar.gz/out.json"); ?


Use PHP's Phar extension. For an introduction, see PHP: Using Phar Archives: Introduction.

file_get_contents("phar://my/path/to/tar/something.tar.gz/out.json");

If you don't already have Phar, you can install the PHP_Archive package or use the PECL extension.

链接地址: http://www.djcxy.com/p/10456.html

上一篇: 逼近一个最接近某个值的公约数?

下一篇: 像文件夹一样使用tar.gz文件?