title: Compressing a directory of files with PHP
body: <p>I am creating a php backup script that will dump everything from a database and save it to a file. I have been successful in doing that but now I need to take hundreds of images in a directory and compress them into one simple .tar.gz file.</p>
  
  <p>What is the best way to do this and how is it done? I have no idea where to start. </p>
  
  <p>Thanks in advance</p>