Reputation: 1819
I've got a custom php script that creates a KML file. Now how do I convert it into KMZ?
Should I just run gzcompress()
on it?
Or should I create a ZipArchive?
Upvotes: 1
Views: 1317
Reputation: 1819
Creating a ZipArchive worked. I add the already created kml file to it.
$zip = new ZipArchive();
$zip_name = "c:\\kml\\".$sFilename.".kmz";
$filename = "c:\\kml\\".$sFilename.".kml";
$zip->open($zip_name, ZIPARCHIVE::CREATE);
$zip->addFile($filename);
$zip->close();
Upvotes: 4