1

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.

hakre
  • 193,403
  • 52
  • 435
  • 836
Paul
  • 661
  • 4
  • 12
  • 22
  • What doesn't work? What errors do you get, where does it fail exactly? – Pekka Jan 22 '11 at 12:14
  • possible duplicate of [php open gzipped xml](http://stackoverflow.com/questions/1190906/php-open-gzipped-xml) – hakre Oct 22 '13 at 12:44

1 Answers1

2

Tried this ?

$xml = new SimpleXMLElement("compress.zlib://$url", NULL, TRUE);
sfk
  • 709
  • 5
  • 14