get header respnse code php curl

Solutions on MaxInterview for get header respnse code php curl by the best coders in the world

showing results for - "get header respnse code php curl"
Till
03 Jul 2017
1$url = 'http://www.example.com';
2$ch = curl_init($url);
3curl_setopt($ch, CURLOPT_HEADER, true);    // we want headers
4curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
5$output = curl_exec($ch);
6$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
7curl_close($ch);
8
9echo 'HTTP code: ' . $httpcode;