How to create ZIP archive from entire folder

I have read:

http://www.exeoutput.com/help/sample-create-zip-archive

Something I cannot figure out if even possible is how to ZIP an entire folder. If this is possible could you give me example how to ZIP the Data folder?

Thanks

You would have to use PHP to list all files in the folder and with a loop, zip all files returned.

scandir is what you need:
http://php.net/manual/fr/function.scandir.php