How can I unzip a .gz file with PHP?

后端 未结 6 1051
南旧
南旧 2020-12-14 11:06

I\'m using CodeIgniter and I can\'t figure out how to unzip files!

6条回答
  •  臣服心动
    2020-12-14 11:48

    gzopen is way too much work. This is more intuitive:

    $zipped = file_get_contents("foo.gz");
    $unzipped = gzdecode($zipped);
    

    works on http pages when the server is spitting out gzipped data also.

提交回复
热议问题