function getCurl($url)
{
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_HEADER, false );
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER,false); //处理http证书问题
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
if (false === $result) {
$result = curl_errno($ch);
}
curl_close($ch);
return $result;
}
网友评论