I want to use curl and post method then I want to get response header (not response source) like set-cookie etc
How can I do this?
I created the below code but it only shows response source:
$ch = curl_init();
curl_setopt($ch,
CURLOPT_URL,"https://www.example.com");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post); //Post Fields
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, 1);
$server_output = curl_exec ($ch);
echo ($server_output);
I tried getinfo($ch);