PHP与Curl采用的get方式请求API

//传入地址即可

function curl_get($url)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_TIMEOUT, 500);
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($curl,CURLOPT_URL,$url);
$res = curl_exec($curl);
curl_close($curl);
return $res;
}

上一篇:PHP代理转发接口


下一篇:查看Nginx版本号方式