Load gzipped XML file with simplexml_load_file()

后端 未结 3 361
小蘑菇
小蘑菇 2020-12-11 08:00

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.

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-11 08:37

    Read it to a string using file_get_contents() decompress it using gzuncompress() and load string as XML using simplexml_load_string().

提交回复
热议问题