You just include this coding into your curl request
curl_setopt($curl_exec, CURLOPT_HEADER, true);
curl_setopt($curl_exec, CURLOPT_NOBODY, true);
after your curl execution use $header_data= curl_getinfo($curl_exec);
Then you get all the headers
print_r($header_data);
or use the shell_exec
echo shell_exec("curl -I http://example.com ");