<?php

$files = array('xml_venda.xml', 'xml_recibo.xml', 'xml_cancela.xml');

$zip = new ZipArchive();
$zip_name = time().".zip"; // Zip name

// $b_get  = file_get_contents('xml/xml_venda.xml');

$zip->open($zip_name, ZipArchive::CREATE);
$zip->addFromString('xml_venda.txt', 'xYBOLINHA');
$zip->addFromString('xml_venda00000.txt', 'x2');
$zip->close();

header('Content-Type: application/zip');
header('Content-disposition: attachment; filename='.$zip_name);
header('Content-Length: ' . filesize($zip_name));
readfile($zip_name);

exit;
 
?>
