public function http_curl($url)
{
$ch = curl_init();
//设置参数
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
//调用接口
$res = curl_exec($ch);
if(curl_errno($ch)){return curl_errno($ch);}
curl_close($ch)
$res = json_decode($res,true);
return $res;
}
{
$ch = curl_init();
//设置参数
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
//调用接口
$res = curl_exec($ch);
if(curl_errno($ch)){return curl_errno($ch);}
curl_close($ch)
$res = json_decode($res,true);
return $res;
}
2017-05-05