I am using cURL for custom HTTP header request. But how can I get PHP to display the headers?
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array('my_key: 12345'));
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
echo "<br><br>";
if($_SERVER['my_key']=='12345'){
echo 'Key is OK';
} else {
echo 'Key is wrong';
}
// also tried!
print_r($_COOKIE);
var_dump (curl_getinfo($ch));
?>