<?php$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$url)//抓取url
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_HEADER,1);
$output=curl_exec($ch);
if($output===false){
echo "抓取页面错误";
}
$info=curl_getinfo($ch);//打印$ch详细信息
curl_close($ch);
echo $output