PHP CURL设置Authorization

$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $linkUrl);curl_setopt($ch, CURLOPT_VERBOSE, 1);curl_setopt($ch, CURLOPT_FAILONERROR, false);curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ‘POST‘);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_HTTPHEADER, [‘Content-Type:application/x-www-form-urlencoded‘]);//设置凭证curl_setopt($ch, CURLOPT_USERPWD, ‘user:pwd‘);curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);