<?PHP//$url = "http://www.baidu.com";$url= "Www.qy.com";$ch= Curl_init ($url); curl_setopt ($ch, Curlopt_header,true);//when enabled, the information for the header file is output as a data stream. curl_setopt ($ch, Curlopt_nobody,true);//when enabled, the body portion of the HTML is not output. curl_setopt ($ch, Curlopt_returntransfer,true);//The information obtained by CURL_EXEC () is returned as a file stream, rather than as a direct output. curl_setopt ($ch, Curlinfo_header_out,true);//the request string to trace the handle when enabled. $response _header= Curl_exec ($ch);//Curl_exec-performing a curl session$meta= Curl_getinfo ($ch);$request _header=$meta[' Request_header '];Var_dump($meta);Var_dump($request _header);Var_dump($response _header);?> requires PHP version greater than 5.1.3
How does PHP print out the HTTP request and response headers of the Curl module interaction?