$result = curl_get http总是请求false 网上的方法试遍了 。我的php 版本 5.6.32 求大神解决下~
function curl_get($url)
{
$ch = curl_init();
//设置选项,包括url
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch,CURLOPT_AUTOREFERER,1);
curl_setopt($ch, CURLOPT_HEADER, 0);
//执行并获取html内容
$output = curl_exec($ch);
//释放curl句柄
curl_close($ch);
return $output ;
}
这是请求函数~ 一请求就报错~
}
function curl_get($url)
{
$ch = curl_init();
//设置选项,包括url
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch,CURLOPT_AUTOREFERER,1);
curl_setopt($ch, CURLOPT_HEADER, 0);
//执行并获取html内容
$output = curl_exec($ch);
//释放curl句柄
curl_close($ch);
return $output ;
}
这是请求函数~ 一请求就报错~
}