title: Zip files in folder using PHP
body: <p>I've a folder which contains all the uploaded files and I am storing path of each file in database according to user id. Now I want to read all files of that particular user and want write all that files into a zipped folder. </p>
  
  <p>How can I do it with PHP?</p>
  
  <p>My code:</p>
  
  <pre><code>// Getting file path here
  $data = $model-&gt;findAll('tree_parent_id=:id', array(':id' =&gt; (int) $model-&gt;id));
  foreach ($data as $type) {
    print_r($type-&gt;path);
  }
  </code></pre>