set_charset("utf8"); // Get All Table Names From the Database $tables = array(); $sql = "SHOW TABLES"; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_row($result)) { $tables[] = $row[0]; } ?> open($zip_file, ZIPARCHIVE::CREATE)!==TRUE) { die("cannot open <$zip_file>\n"); } $files = 0; $paths = array($main_path); while (list(, $path) = each($paths)) { foreach (glob($path.'/*') as $p) { if (is_dir($p)) { $paths[] = $p; } else { $zip->addFile($p); $files++; echo $p."
\n"; } } } echo 'Total files: '.$files; $zip->close(); } ?>