title: How to zip files in codeigniter?
body: <p>I write this code to create a zip file from my images</p>
  
  <pre><code>        $path = '/path/to/file/icon1.png';
          $path2 = '/path/to/file/icon2.png';
          $this-&gt;zip-&gt;read_file($path);
          $this-&gt;zip-&gt;read_file($path2);
          $this-&gt;zip-&gt;archive('/root/myarchive.zip'); 
  </code></pre>
  
  <p>Now i want to add a directory using <code>add_dir</code> for example <code>Image</code> and then add <code>$path</code> and <code>$path2</code> to this folder and then create an archive (by default CI save these images to the root of zip file)</p>