The php Function Curl_Setopt_Array
The php function curl_setopt_array sets options in a cURL transfer session. The function takes an array of options as input, and sets the values for each option in turn. The return value is the cURL resource handle, or FALSE on errors.
PHP 7.6 introduces new cURL options including CURLOPT_FOLLOWLOCATION, CURLOPT_SSL_VERIFYPEER, and CURLOPT_PROXYAUTH. Previously, these options could only be set with the curl_setopt() function. These new cURL options can also be set with the new curl_setopt_array() function, which makes setting multiple options easier.
Using the new cURL options requires PHP to be compiled with libcurl 7.62 or higher. PHP will automatically use the latest version of libcurl if possible, but some operating systems may still need to be updated before the new functions are available.
For example, CURLOPT_FOLLOWLOCATION enables cURL to follow HTTP redirections. This is useful if you need to download files from a server that uses a different URL than the original file.
CURLOPT_COOKIEJAR allows you to specify the name of the cookie file to write, while CURLOPT_GSSNEGOTIATE and CURLOPT_NTLM enable you to set an authentication method that cURL will try to negotiate with the server. You can also set the maximum number of seconds a connection will be allowed to last with the CURLOPT_TIMECONDITION option. If you have a slow internet connection, this option lets you limit the transfer speed that cURL will try to send. If the transfer is below this threshold for too long, a transfer error will be generated.