I am working with our Java team to pass a stream of data from a Java client app to my PHP page. We were doing this in XML and everything worked great, but now they are sending me a ZIP datastream. All functions I've found for reading ZIP files in PHP require a file, which I don't have. I take the ZIP datastream sent to me and throw it in a variable. How do I read or "unzip" this? Is it even possible? I've already tried creating a ZIP file on the fly using fopen and the extension ".zip" and stuffing the ZIP data into it but it doesn't work, says it is an invalid archive. And I cannot create a real ZIP file on the fly because the data I'm receiving is already zipped.
Here is the code I use to accept the datastream:
$variable = file_get_contents("php://input");
how can I unzip the data in $variable?