Sami Sami - 3 months ago 18x
PHP Question

How to get content of a single text or a single json file inside a .tar.gz file in PHP?

I have a

file of a folder with 1,000,000 unique
files. I tried to use the
echo $a;
takes forever to load on browser. Any help is appreciated.


A .tar.gz file cannot be accessed randomly. All of the files up to the one you want must be decompressed.

You can try using a .zip file instead, which will permit rapid random access. However the compression of many small files could be much worse, since zip entries are compressed independently and not able to use repeated information in the previous files to aid in the compression of subsequent files.