This is my code zip 1 file:
$zipname="C:/xampp/htdocs/test/5/JPN/5/5_1.0.pdf.zip"
$zip = new ZipArchive;
$zip->open($zipname, ZipArchive::CREATE);
$zip->addFile("C:/xampp/htdocs/test/5/JPN/5/5_1.0.pdf");
$zip->close();
Why ZipArchive working not correct?
You need to pass two parameters in the addFile function.
According to the documentation
This means that the first parameter is the path to the actual file in the filesystem and the second is the path & filename that the file will have in the archive.
The following code will work for you