luguokankan 发表于 2013-9-14 17:32 
做出来记得给我一份啊
您这样的大牛,博士生导师级别的, 拿小弟开玩笑吧 呵呵 
这个是我实现的代码:
<?php
$url = 'http://arcadegameworld.com/play/stone-age-mahjong-connect/';
$header = get_header($url);
echo $header;
function get_header($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY,true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch, CURLOPT_AUTOREFERER,true);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Accept: */*',
'User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)',
'Connection: Keep-Alive'));
$header = curl_exec($C);
return $header;
}
?>
运行后的结果:
|