Now the variable $zip contains your zip file, and you can save it to disk or do something else with it.
If it’s a large file, it’s probably best to save it to disk while downloading:
Curl error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Add this option where you’re setting the other options:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
VERY IMPORTANT NOTE!
This options makes curl assume that the SSL connection you’re connecting to is trusted and doesn’t check it against the CA’s certificate.
This means it will still download the file if someone else manages to hijack/ spoof the connection…