I'm trying to load a gzipped XML file using simplexml_load_file() PHP function, but I don't know how to decode it so I can use the data in it.
PHP has support for zlib compression build-in, just prefix the path of your file with the gzip'ed data with compress.zlib:// and you're done:
compress.zlib://
$xml = simplexml_load_file("compress.zlib://test.xml");
Works like a charm.
2.1m questions
2.1m answers
60 comments
57.0k users