Yngvarr

Generation

generate functionSat, 07 Jan 2023

gzencode and save archive

function gz_archive($file_path, $output_file, $level = 5) { $buffer = ''; $gz = gzopen($output_file, 'wb' . $level); $file = fopen($file_path, 'rb'); while (!feof($file)) { $buffer = fread($file, 10240); gzwrite($gz, $buffer); } gzclose($gz); fclose($file); }

Questions about programming?Chat with your personal AI assistant