someone please help me know the difference about setting opt in curl php.
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "abcxyz",
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language: en-US,en;q=0.5",
"Cache-Control: no-cache",
"Connection: keep-alive",
"Cookie: ht=7635aa7ceda60bf1",
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0"
),
));
and
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "abcxyz",
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "ht=7635aa7ceda60bf1",
CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0",
CURLOPT_HTTPHEADER => array(
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language: en-US,en;q=0.5",
"Cache-Control: no-cache",
"Connection: keep-alive"
),
));
I always get error when trying to use CURLOPT_COOKIE and CURLOPT_USERAGENT.