function posturl($gateurl,$data){
$headers = array("Content-type: application/x-www-form-urlencoded", "'charset='utf-8'");
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$gateurl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch ,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch ,CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$res = curl_exec($ch);
curl_close($ch);
$result = json_decode($res, true);
return $result;
}