Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $path_zip = "dnamusic.zip";
- $tmp_folder = "dnamusic/";
- $all_files = array();
- $zip = zip_open($path_zip);
- if ($zip) {
- $stream = zip_read($zip);
- while ($stream) {
- var_dump($zip_name);
- $zip_name = zip_entry_name($stream);
- $path_file_unzip = $tmp_folder.$zip_name;
- $dir_folder = substr($path_file_unzip, 0, strrpos($path_file_unzip, "/"));
- print_r($path_file_unzip);
- if (!file_exists($dir_folder)){ mkdir($dir_folder,0777,true);
- }
- if (!file_exists($path_file_unzip)){
- $fp = fopen($path_file_unzip, "w");
- echo("$path_file_unzip is a regular file");
- array_push($all_files, $path_file_unzip);
- if(zip_entry_open($zip, $stream, "r")) {
- $buf = zip_entry_read($stream, zip_entry_filesize($stream));
- fwrite($fp, "$buf");
- zip_entry_close($stream);
- fclose($fp);
- }
- }
- $stream = zip_read($zip);
- }
- zip_close($zip);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement