标签:exec ring func header etop code close fun null
public function sendHttpRequest($url,$url_param = null,$body_param = null,$is_post = true) { if($url_param){ $url_param = ‘?‘.http_build_query($url_param); } if($body_param){ $body_param = json_encode($body_param); } $ch = curl_init($url.$url_param); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); if($is_post){ curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $body_param); } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); $data = curl_exec($ch); curl_close($ch); return $data; }
标签:exec ring func header etop code close fun null
原文地址:https://www.cnblogs.com/mmmzh/p/10124052.html