[Solved] Do not remove duplicate values from array
Just rename your files. <?php # define file array $files = array( ‘https://www.fbise.edu.pk/Old%20Question%20Paper/2017/SSC-II/Chemistry.PDF’, ‘https://www.fbise.edu.pk/Old%20Question%20Paper/2018/SSC-II/Chemistry.PDF’, ‘https://www.fbise.edu.pk/Old%20Question%20Paper/2018/SSC-II/Physics.PDF’, ‘https://www.fbise.edu.pk/Old%20Question%20Paper/2017/SSC-II/Physics.PDF’, ); # create new zip object $zip = new ZipArchive(); # create a temp file & open it $tmp_file = tempnam(‘.’, ”); $zip->open($tmp_file, ZipArchive::CREATE); // Variable to Keep Filenames $filename=””; // Variable to add “-1, -2” to duplicate files … Read more