$zip = new ZipArchive;
{
//Equivalent to deleting the entire compressed package file, and then add a picture to them
$zip->addFile('test.png');
//Updating the compressed package is equivalent to re-compressing
addFileToZip('Resources/', $zip); //Call the method, operate on the root directory to be packaged, and pass the ZipArchive object to the method
$zip->close(); //Close the processed zip file
// echo 'ok';
} else {
echo "
}
Note: Because it cannot be deleted, it is achieved by importing an image first.
The above introduces the function of PHP to solve the problem of deleting zip, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.