How can i remove or delete a zip folder using php code?
In my application i need to extract a zip folder after extaracting remove the zip folder.
How can i do this?
I can extract or unzip the zipped folder using php code that will successed.
But i dont know hot remove the zipped folder.
This is the code to extract zip folder:
$this->load->library('unzip');
$var = $this->unzip->extract('./folder/zip_foldername', './folder/newname');
Use the unlink() function
http://www.php.net/manual/en/function.unlink.php
Edit: after reading your post again I’m not sure I understood. Did you mean to delete the zip file or the resulting folder containing all the extracted files? If the the latter then you would first need to loop through that directory and use unlink to delete all of the files then use rmdir() to delete the directory
http://php.net/manual/en/function.rmdir.php