**EDIT***
I've been having a hard time setting up the password to my files. I basically just want to protect the files that are going to be compressed into a zip file. So far, this is my code to zip the files.
I tried using system('zip -P password zipfile.zip file.extension'); but id doesn't seem to work.
*edited code
$files = array(
'packages/download.xml',
'packages/script_'.date("j.n.Y").'.xml',
);
$zip = new ZipArchive();
$zip_name = "packages/test.package";
if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE){
$error .= "* Sorry ZIP creation failed at this time";
}
foreach($files as $file){
$zip->addFile($file);
}
system('zip -P password zipfile.zip file.extension');
$zip->close();