$ch = curl_init();
curl_setopt($ch, CURLOPT_URL , 'ghxter.blogbot.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1);
curl_setopt($ch, CURLOPT_TIMEOUT , 5);
curl_setopt($ch, CURLOPT_USERAGENT , $_SERVER['HTTP_USER_AGENT']);
$response = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
var_dump($info);
var_dump($response)
?>
也可参考另一文章:curl_setopt($ch, CURLOPT_RETURNTRANSFER,1) 使用
没有评论:
发表评论