Hello, i have created a zip file creation program in php and i used ubantu as my os. it works fine on that but when i run that on window it gives me error and not creating any zip file .
Here is the code:
$Zip = new ZipArchive();
$filelocation = 'update';
$Ziplocation = 'ZipVila/ZipEx.zip';
$Zipfolder = 'ZipVila';
$Zip->open($Ziplocation, ZipArchive::CREATE | ZipArchive::OVERWRITE);
$files = scandir($filelocation);
print_r($files);
unset($file[0], $file[1]); // window gives error in this line, it shows object file is not defined.
foreach ($files as $file) {
$Zip->addfile($filelocation."/{$file}", $file);
echo "File Added";
}
$Zip->close();
echo "Zip Closed";
?>
This work totally fine on my ubantu but not running well on my Window
please can anyone tell me what is the error here ?
thanks