/**
* 发送HTTP请求并获得响应
* @param url 请求的url地址
* @param param 发送的http参数
*/function makeRequest($url, $param, $httpMethod = 'GET') {<br>
$oCurl = curl_init();<br>
if (stripos($url, "https://") !== FALSE) {<br>
curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE);<br>
curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, FALSE);<br>
}<br>
<br>
if ($httpMethod == 'GET') {<br>
curl_setopt($oCurl, CURLOPT_URL, $url . "?" . http_build_query($param));<br>
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1);<br>
} else {<br>
curl_setopt($oCurl, CURLOPT_URL, $url);<br>
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1);<br>
curl_setopt($oCurl, CURLOPT_POST, 1);<br>
curl_setopt($oCurl, CURLOPT_POSTFIELDS, http_build_query($param));<br>
}<br>
<br>
$sContent = curl_exec($oCurl);<br>
$aStatus = curl_getinfo($oCurl);<br>
curl_close($oCurl);<br>
if (intval($aStatus["http_code"]) == 200) {<br>
return $sContent;<br>
} else {<br>
return FALSE;<br>
}<br>
}
AD:真正免费,域名+虚机+企业邮箱=0元