<?php
$zip = new ZipArchive();
$filename = "./test112.zip";
if ($zip->open($filename, ZipArchive::CREATE)!==TRUE) {
exit("<$filename> açılamadı\n");
}
$zip->addFromString("testfilephp.txt" . time(),
"#1 Bu, testfilephp.txt olarak eklenen bir deneme dizgesidir.\n");
$zip->addFromString("testfilephp2.txt" . time(),
"#2 Bu, testfilephp2.txt olarak eklenen bir deneme dizgesidir.\n");
$zip->addFile($thisdir . "/too.php","/testfromfile.php");
echo "dosya sayısı: " . $zip->numFiles . "\n";
echo "durum:" . $zip->status . "\n";
$zip->close();
?>