public static function postCurl($postData, $url, $second = 30) {
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => $second,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => http_build_query($postData),
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded", // $_POST进行接收
"cache-control: no-cache"
),
));
$data = curl_exec($curl);
curl_error($curl);
return $data;
}