I'm getting a gzipped File from an FTP Server that contains an xml. I want to gunzip it und write the xml as a file.
This is the code I'm using right now:
ftp_get($ftpCon, __DIR__."/../files/data.gz", $val, FTP_BINARY);
$srcName = __DIR__."/../files/data.gz";
$dstName = __DIR__."/../files/stuff.xml";
$command = 'gunzip -c '.$srcName.' > '.$dstName;
$escapedCommand = escapeshellcmd($command);
system($escapedCommand);
But the XML File will be printed out on the console and not written into a file. How can I write the data from the zipped file into an XML file?