PHP ZipArchive close() Function
The PHP ZipArchive::close() function is an inbuilt function in PHP that is used to close the opened archive file and save the changes. This function is called after performing all operations on the zip file. If the zip archive does not contain any file then by default zip file is deleted.
Parameters: This function does not accept any parameter.
Return Value: This function returns “true” on success and “false” on failure.
Example 1: In this example, we will describe the ZipArchive::close() function. First, we will open the zip archive and add a directory to the file, and add then close the file.
Example 2: In this example, we will open the zip archive and add a file with some string content, and after performing the operation, we will use ZipArchive::close() function to close the file.
Please Login to comment...