1:设置定时器
2:定时器请求接口代码
代码块
$data_string = $list; //$list存放携带数据
$ch = curl_init('http://域名/Admin/Push/entry');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$result = curl_exec($ch);
public function entry()
{
$postData = file_get_contents('php://input');
$postData = json_decode($postData, true);
}
网友评论