做出来记得给我一份啊
您这样的大牛,博士生导师级别的, 拿小弟开玩笑吧呵呵 :)
这个是我实现的代码:
<?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;
}
?>
运行后的结果:
HTTP/1.1 200 OK
Date: Sat, 14 Sep 2013 09:28:54 GMT
Server: Apache
X-Pingback: http://arcadegameworld.com/xmlrpc.php
Link: <http://arcadegameworld.com/?p=3155>; rel=shortlink
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=UTF-8
HONG 发表于 2013-9-14 17:35 static/image/common/back.gif
您这样的大牛,博士生导师级别的, 拿小弟开玩笑吧呵呵
这个是我实现的代码:
打算用php来做评论吗? 可以使用rollingcurl库
https://github.com/takinbo/rolling-curl
good luck!
有位兄弟回答了,确实可以直接在post里面看
这个原理不知道。。这个行业水深,大神很多
页:
1
[2]