title: PHPMailer ZIP all attachments
body: <p>I am using PHPMailer to send attachments to email.</p>
  
  <p>I have if statements such as:</p>
  
  <pre><code>if(isset($_POST['checkbox1'])) {
     $mail-&gt;addAttachment('pdf/1.pdf');
     $name = "PDF 1";
  }
  if(isset($_POST['checkbox2'])) {
     $mail-&gt;addAttachment('pdf/2.pdf');
     $name = "PDF 2"&gt;
  }
  </code></pre>
  
  <p>At the end for every checkbox selected I want to compress all attachments and put them in a zip instead of just sending one by one.</p>