Umm, you get a list of songs.
You invoke the zip program (if it's installed on the server ... this part is very important). 😃
The zip file is created in the temp directory, or a directory owned by you.
And your script then sends a header for the page to be served as an attachment ... which consists of the zip file.