I've got a script which fetches zipped content from a web page. Under normal circumstances the browser would donwload this as a zip file, but for my script the remote server just returns the compressed string, and I'm trying to figure out how to uncompress it. Apparently it's compressed using PKzip if that's any help.

I've tried just writing it to a file
$fh = fopen("zipfile.zip","w");
But when I try to open the zip file (after writing it) it appears to be invalid.

I've tried gzuncompress() and gzinflate(), eg
echo gzinflate($zippedString);
but it still outputs gibberish.

Any ideas?