Open remote gzip XML file for use with SimpleXML

2019-04-15 12:21发布

I'm having trouble retrieving and decompressing a remote gzip XML file.

To get the file I'm using:

$url = 'http://www.domain.com/xml.gzip';
$linkToXmlFile = fopen("compress.zlib://$url", "r");

Then I've tried:

try {
    $xml = new SimpleXmlElement($rawFeed);
    ...
}

To no avail.

标签: php xml gzip
1条回答
你好瞎i
2楼-- · 2019-04-15 12:46

Tried this ?

$xml = new SimpleXMLElement("compress.zlib://$url", NULL, TRUE);
查看更多
登录 后发表回答