Use tar.gz file as a folder?

Does PHP have an extension that allows tar.gz to be used as a folder?

I have a file that uses a similar structure, and I do not need to extract everything to read information about it, so I can do file_get_contents("my/path/to/tar/something.tar.gz/out.json"); ?

+7
source share
1 answer

Use PHP Phar Extension. For an introduction, see PHP: Using Phar Archives: An Introduction .

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

If you do not already have Phar, you can install the PHP_Archive package or use the PECL extension .

+3
source

All Articles