php异步请求,异步处理机制,网页异步获取数据
[php]
/**
* 发送HTTP请求并获得响应
* @param url 请求的url地址
* @param param 发送的http参数
*/
function makeRequest($url, $param, $httpMethod = 'GET') {
$oCurl = curl_init();
if (stripos($url, "https://") !== FALSE) {
curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, FALSE);
}
if ($httpMethod == 'GET') {
curl_setopt($oCur...